1. Win32lib ?
- Posted by euman at bellsouth.net Mar 21, 2002
- 565 views
Not normally using the "Lib" Im confused. I put a tabcontrol on my hWnd and a tabitem for the tabcontrol then created a groupbox and added a treeview control to this groupbox. How come I can not have a popup for this treeview control? Euman euman at bellsouth.net Q: Are we monetarily insane? A: YES
2. Re: Win32lib ?
- Posted by Derek Parnell <ddparnell at bigpond.com> Mar 21, 2002
- 535 views
Ummm, do you mean a popup menu? or something else? ----- Original Message ----- From: <euman at bellsouth.net> To: "EUforum" <EUforum at topica.com> Subject: Win32lib ? > > Not normally using the "Lib" Im confused. > > I put a tabcontrol on my hWnd and a tabitem for the tabcontrol then > created a groupbox and added a treeview control to this groupbox. > > How come I can not have a popup for this treeview control? > > Euman > euman at bellsouth.net > > Q: Are we monetarily insane? > A: YES > > > >
3. Re: Win32lib ?
- Posted by euman at bellsouth.net Mar 21, 2002
- 524 views
----- Original Message ----- From: "Derek Parnell" <ddparnell at bigpond.com> > Ummm, do you mean a popup menu? or something else? PopUp Menu Euman euman at bellsouth.net
4. Re: Win32lib ?
- Posted by Derek Parnell <ddparnell at bigpond.com> Mar 21, 2002
- 516 views
Ok. Just let me get this straight. You called the popup() routine, specifying which popup menu you wanted, and where it was to be displayed, and nothing happened. Is that right? Maybe you could give us more of hint about what you actually did and what actually happened (as opposed what didn't happen). --------- Derek. 22/03/2002 8:21:08 AM, euman at bellsouth.net wrote: > >----- Original Message ----- >From: "Derek Parnell" <ddparnell at bigpond.com> > >> Ummm, do you mean a popup menu? or something else? > >PopUp Menu > >Euman >euman at bellsouth.net > > > > --------- Cheers, Derek Parnell ICQ# 7647806
5. Re: Win32lib ?
- Posted by euman at bellsouth.net Mar 21, 2002
- 527 views
----- Original Message ----- From: "Derek Parnell" <ddparnell at bigpond.com> > Ok. Just let me get this straight. > > You called the popup() routine, specifying which popup menu you wanted, and > where it was to be > displayed, and nothing happened. Is that right? > > Maybe you could give us more of hint about what you actually did and what > actually happened (as > opposed what didn't happen). Hello again Derek, I really thought my explanation two post ago was quit good but what better way to do this than to actually give you code that doesnt work... You should be able to run the demo and right click on the treeview for a popup menu but this doesnt happen. <snip.. code> -- code generated by Win32Lib IDE v0.12.0 -- Win32lib 55.5 dated: 25/02/2002 at 23:09:55 by Derek Parnell include Win32Lib.ew without warning -------------------------------------------------------------------------------- -- Window Window1 global constant Window1 = create( Window, "Window1", 0, Default, Default, 400, 300, 0 ) global constant TabControl2 = create( TabControl, "TabControl2", Window1, 4, 4, 384, 268, 0 ) global constant TabItem3 = create( TabItem, "TabItem3", TabControl2, 0, 0, 0, 0, 0 ) global constant Group4 = create( Group, "Group4", TabItem3, 8, 32, 368, 228, 0 ) global constant TV2 = create( TreeView, "TreeView5", Group4, 8, 16, 352, 208, or_all({TVS_HASLINES,TVS_LINESATROOT,TVS_HASBUTTONS,TVS_SHOWSELALWAYS}) ) global constant Popup_101 = create( Popup, "Popup 101", TV2, 0, 0, 0, 0, 0 ) global constant PopupItem_102 = create( MenuItem, "temp", Popup_101, 0, 0, 0, 0, 0 ) global constant PopupItem_103 = create( MenuItem, "temp", Popup_101, 0, 0, 0, 0, 0 ) global constant PopupItem_104 = create( MenuItem, "-", Popup_101, 0, 0, 0, 0, 0 ) global constant PopupItem_105 = create( MenuItem, "temp", Popup_101, 0, 0, 0, 0, 0 ) constant closefolder = addIcon( extractIcon( "clsdfold.ico" ) ) constant openfolder = addIcon( extractIcon( "openfold.ico" ) ) --------------------------------------------------------- sequence folders folders = {} folders &= addTVItem( TV2, closefolder, openfolder, "HKEY_CURRENT_USER" , 0 ) folders &= addTVItem( TV2, closefolder, openfolder, "HKEY_LOCAL_MACHINE" , 0 ) WinMain( Window1,Normal ) <snip... code> Euman euman at bellsouth.net
6. Re: Win32lib ?
- Posted by Derek Parnell <ddparnell at bigpond.com> Mar 21, 2002
- 506 views
22/03/2002 1:02:54 PM, euman at bellsouth.net wrote: > >----- Original Message ----- >From: "Derek Parnell" <ddparnell at bigpond.com> > >> Ok. Just let me get this straight. >> >> You called the popup() routine, specifying which popup menu you wanted, and >> where it was to be >> displayed, and nothing happened. Is that right? >> >> Maybe you could give us more of hint about what you actually did and what >> actually happened (as >> opposed what didn't happen). > >Hello again Derek, > >I really thought my explanation two post ago was quit good but >what better way to do this than to actually give you code that doesnt work... > >You should be able to run the demo and right click on the treeview for a popup >menu >but this doesnt happen. > ><snip.. code> > >-- code generated by Win32Lib IDE v0.12.0 >-- Win32lib 55.5 dated: 25/02/2002 at 23:09:55 by Derek Parnell > >include Win32Lib.ew >without warning > >>-------------------------------------------------------------------------------- >-- Window Window1 >global constant Window1 = create( Window, "Window1", 0, Default, Default, 400, >300, 0 ) >global constant TabControl2 = create( TabControl, "TabControl2", Window1, 4, 4, >384, 268, 0 ) >global constant TabItem3 = create( TabItem, "TabItem3", TabControl2, 0, 0, 0, >0, 0 ) >global constant Group4 = create( Group, "Group4", TabItem3, 8, 32, 368, 228, 0 >) >global constant TV2 = create( TreeView, "TreeView5", Group4, 8, 16, 352, 208, >or_all({TVS_HASLINES,TVS_LINESATROOT,TVS_HASBUTTONS,TVS_SHOWSELALWAYS}) ) >global constant Popup_101 = create( Popup, "Popup 101", TV2, 0, 0, 0, 0, 0 ) >global constant PopupItem_102 = create( MenuItem, "temp", Popup_101, 0, 0, 0, >0, 0 ) >global constant PopupItem_103 = create( MenuItem, "temp", Popup_101, 0, 0, 0, >0, 0 ) >global constant PopupItem_104 = create( MenuItem, "-", Popup_101, 0, 0, 0, 0, 0 >) >global constant PopupItem_105 = create( MenuItem, "temp", Popup_101, 0, 0, 0, >0, 0 ) > >constant closefolder = addIcon( extractIcon( "clsdfold.ico" ) ) >constant openfolder = addIcon( extractIcon( "openfold.ico" ) ) >--------------------------------------------------------- >sequence folders >folders = {} >folders &= addTVItem( TV2, closefolder, openfolder, "HKEY_CURRENT_USER" , 0 ) >folders &= addTVItem( TV2, closefolder, openfolder, "HKEY_LOCAL_MACHINE" , 0 ) > >WinMain( Window1,Normal ) > Okay, now I see the problem. I guess you were expecting win32lib to show the popup menu when the user clicked the right-mouse button (I suppose) in the treeview? This is not how it is designed to work. You must detect the triggering mechanism and explicitly call popup() to display the menu. The problem with letting win32lib do this is it doesn't know what the trigger mechanism will be, nor does it know where on the screen you want the menu to display. For example, you might want different popup menus to display for Ctrl-RButton, and Alt-RButton. And do you want them directly under the mouse pointer? Or maybe shown in such a way that it doesn't obscure the control underneath. May you need it relative to the top-left corner of the control? There are just too many varaitions for me to make an educated guess. Popup menus are not designed to be associated with any specific control. It is better to have the Window own them. Look at the popup menu example program that comes with win32lib for some more variations on a theme. --------- Cheers, Derek Parnell ICQ# 7647806