April 24, 2024, 04:33:16 AM

News:

IonicWind Snippit Manager 2.xx Released!  Install it on a memory stick and take it with you!  With or without IWBasic!


Context menu with list box

Started by Andy, January 05, 2012, 05:47:13 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Andy

Hi,

I have a list box with web browing history in it and built up by using the ADDSTRING command.

Is there a way you can create a context menu on a selected item in the list box?

eg,

This list box could have two entries in such as:

www.1stpage.com
www.2ndpage.com

when you click on www.2ndpage.com and right click I would like a small context menu to appear with an item that says 'Open security centre' - when they select this option I want to use the SYSTEM command to execute an external program.

does anyone have an example of how I can do this?

Thanks Andy,

And happy new year to all!
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Brian

Hi,

Fletchie's Control Pak has a call to right-click in a listbox. You could start from there

Brian


Andy

Hi Brian,

Thats great but where can I find Fletchie's Control Pak?

Thanks,
Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Brian


Andy

Hi Brian and all,

Thanks for that, I can create context menus with normal windows but I cannot get a context menu on the history screen.

Larry helped with the history screen, you simply click on the 'History' button and a browsing history list appears, it's this list I would like to have a context menu on and i'm struggling with this.

Attached is the modified browser example with the history button included.

If anyone could help some more I would be very greatful!

Thanks,
Andy.

Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Brian

Andy, your code is too complicated for me!

All I can do is attach a test file, showing how Ian intended conLBRightClick to work

Best of luck!

Brian

Doc

Hello Andy,
I just tried compiling your code, just to check it out, but received an error harping about a missing include file.

Using Compiler Version: 2.0519, I got:
browser_test2modified.iwb (9) Error: Unable to Open - string.inc.

Where might I find the include file?

-Doc-

Doc

Quote from: Brian Pugh on January 06, 2012, 12:21:47 PM
Andy, your code is too complicated for me!

All I can do is attach a test file, showing how Ian intended conLBRightClick to work

Best of luck!

Brian


That also brings a question to mind for Brian as well...
Do you actually still have all of Fletchie's samples and documentation that you'd like to share?
I think I have all that stuff archived along with all of my old IB stuff dating WAY back, but I'm uncertain which CD I have it on and exactly where it might be at the moment.

It's really not a big deal if you don't, as I can likely find it around here somewhere. I always admired Fletchie's work, not to mention remembering just what a great guy he was to everyone. Too bad things didn't turn out different...

-Doc-

Andy

Hi Brian and Doc,

Brian, thanks for the example program thats exactly what I want but it's very complicated in the browser example as it can open multiple screens, confused with this but I will keep trying!

Doc, the string.inc file is attached here, and it goes in 'Program Files\iwbdev\include' folder.

Thanks to both of you for trying, if you do come up with anything please let me know.

Once again thanks for trying  :)

Andy. 
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Brian

January 07, 2012, 04:02:01 AM #9 Last Edit: January 07, 2012, 04:04:00 AM by Brian Pugh
Doc,

I'll take a look, as time permits. Probably going out a walk today. We have a favourite - take a
bus about 12 miles down the valley, walk back along the canal bank. We can come off at most
places and catch the bus again if our little legs get tired!

Didn't have any problems compiling, though

Brian

Andy, just seen your post. That was my problem: I just didn't know where to place the calls

Brian

Doc,

Found the samples - going through them to make sure they all work

Will post later...

Brian

Brian

OK, Doc, zip file attached...

Needed two include files - processapi.inc and uiapi.inc - which I couldn't find, but I think
only two of the examples needed them anyway

Couldn't figure out the FileBits stuff - maybe they are not part of Ian's Control
Pak at all?

If anyone can find the above include files, I would like to see them

Brian

Brian

Hmmm, seems FileBits was an IBasic project. It includes a file called FileBits.ibo,
which was an IBasic Component. Looks very similar in structure to a .lib file,
but I had no luck renaming and using it as such

If anyone knows how to deal with this sort of file, let me know

Had to call it FileBits.inc, or else it wouldn't upload!

Brian 

Doc

Thanks for all of the above guys!
Gonna work my way through the examples that Fletchie provided as a learning exercise... should be interesting. ;)
...and will try the ibo file in Creative as well.

@Andy
I was able to compile your code and create an executable, but the app crashes with a message immediately when launched. It means nothing on my end, but here are the details provided by Windows:

Problem signature:
  Problem Event Name: APPCRASH
  Application Name: browser_test2modified.exe
  Application Version: 0.0.0.0
  Application Timestamp: 4f088585
  Fault Module Name: ntdll.dll
  Fault Module Version: 6.1.7601.17514
  Fault Module Timestamp: 4ce7ba58
  Exception Code: c0000005
  Exception Offset: 0002dfc4
  OS Version: 6.1.7601.2.1.0.768.3
  Locale ID: 1033
  Additional Information 1: ac9b
  Additional Information 2: ac9bc7bd6ec595b26b52f3735363cf03
  Additional Information 3: c543
  Additional Information 4: c5437d18735d350c6801ca1736f77f49


If it's any help, I'm running a 64bit version of Win 7 Home Premium.

Best regards,
-Doc-

aurelCB

Sorry guys if im little bit offtopic but from what i see Fletchie ctl.inc cannot work without ctl.lib
and what is exactly this lib file ,it looks that is not written in ibpro ???

Brian

Aurel,

You can get all the ctl files you need by following the link in the fourth
topic on this page

Brian

Andy

Doc,

You need to be on the very latest version of IWB and you need to run the header program to get ALL updates.

Once you have done that the code will work.

Don't know if your on the latest version of IWB but if not I would think before updating as some of the syntax is slightly different and I had to re-write a lot of code after updating.

Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.

Doc

Thanks for the info Andy.

Looks like I'm running behind on compiler updates for sure... I'm using using Version: 2.0519 and it appears that the latest is 2.09 something or another. Won't make any difference on my end specifically, since I don't have any on-going projects in the works at the moment.

Thanks a lot, sir.

-Doc-

LarryMc

Quote from: andy1966 on January 05, 2012, 05:47:13 AM
Is there a way you can create a context menu on a selected item in the list box?

eg,

This list box could have two entries in such as:

www.1stpage.com
www.2ndpage.com

when you click on www.2ndpage.com and right click I would like a small context menu to appear with an item that says 'Open security centre' - when they select this option I want to use the SYSTEM command to execute an external program.


The way I read your question you don't need a context menu.  A context usually contains multiple choices of options like when you right click in the ediot and you can cut/copy/paster/select all etc.

You stated there will be only one option 'Open security centre'.
If that is true then all you need is a dialog to execute or cancel.

Now, if there are to be multiple options available when a user selects a history entry and right clicks then you do need a context menu.

Even though, as I said I don't think you need it< I'll look into the context menu.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

I think this does what you want; at least as I understand it.

LarryMc
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Andy

Larry,

Thank you very much, that was exactly what I was looking for!

Yes, it's true a context menu with just one option seems a bit silly but I just wanted to add an option here and not anywhere else.

Thank you again so much Larry  :)

Andy.
Day after day, day after day, we struck nor breath nor motion, as idle as a painted ship upon a painted ocean.