1. Custom Dialogs
- Posted by Virtual B <behaviorself at netzero.net> Mar 29, 2003
- 375 views
Hi All, I was wondering if anyone has had any experience with custom dialog boxes. I need a modeless dialog with a combo and a few pushbuttons to get some user input. I would just make a window to handle this, but there is a good chance that I will need more than one (possibly several) of these open at the same time. I haven't been able to find any examples of this using Euphoria, and I'm having quite a time trying to get any useful information at all. Is it possible to do this with Euphoria, or would I need to use the API? I would appreciate any help I can get on this. Thanks, Virtual B
2. Re: Custom Dialogs
- Posted by Virtual B <behaviorself at netzero.net> Mar 31, 2003
- 380 views
Hi Bernie, Thanks for the input. I've been looking over the files you suggested, and I'm starting to get an idea of how it works. I think it is just what I need, but I need to know a couple of things. I have zero experience with resource files, so please bear with me. I need to know if I will be able to access the user's input from the dialog (which item was selected from the combo and which button was pressed), and if so, how to get the info. So far, the only dialog I've seen in your demo is basically like a standard modal message box. I'll keep plugging away at it to see if I can figure it out, but any additional info you can supply would be greatly appreciated. Thanks again, Virtual B ----- Original Message ----- From: Bernie Ryan <xotron at bluefrognet.net> To: EUforum <EUforum at topica.com> Sent: Saturday, March 29, 2003 12:42 PM Subject: RE: Custom Dialogs > > > > I was wondering if anyone has had any experience with custom dialog > > boxes. I need a modeless dialog with a combo and a few pushbuttons to > > get some user input. I would just make a window to handle this, but > > there is a good chance that I will need more than one (possibly several) > > of these open at the same time. I haven't been able to find any > > examples of this using Euphoria, and I'm having quite a time trying to > > get any useful information at all. Is it possible to do this with > > Euphoria, or would I need to use the API? I would appreciate any help I > > can get on this. > > Virtual B: > > The easiest way to create custom dialogs is to: > 1: Create a .RC file description of your dialog box using a text editor. > 2: Compile the .RC file and .H into a .RES file. > 3: Download http://www.rapideuphoria.com/win32eru.zip > 4: Use my win32eru program to the .RES file compile into a euphoria include > .E file. This file will generate win32 code to create the dialog box. > > You can use win32eru and this method to create any resource. > > If you don't have one you can download a FREE resource compiler from here : > http://www.godevtool.com/ > > Bernie > > > > TOPICA - Start your own email discussion group. FREE! > > ---
3. Re: Custom Dialogs
- Posted by Derek Parnell <ddparnell at bigpond.com> Mar 31, 2003
- 361 views
On Sun, 30 Mar 2003 22:27:06 -0800, Virtual B <behaviorself at netzero.net> wrote: > > Hi Bernie, > > Thanks for the input. I've been looking over the files you suggested, > and > I'm starting to get an idea of how it works [snip] BTW, you can do want you want with win32lib, unless there is something I've misunderstood in your request. Have you tried that library and/or do you need examples? -- cheers, Derek Parnell
4. Re: Custom Dialogs
- Posted by Virtual B <behaviorself at netzero.net> Mar 31, 2003
- 393 views
Hi Derek, I'm using Win32Lib, but I haven't gotten much coding time lately, and I probably missed something. What I need (I think) is a modeless dialog with a combo and a few pushbuttons to get some input from the user. I will probably need more than one dialog visible at any given time, and will need to retrieve the user's input from each dialog that is open. I think Win32Lib is GREAT, and if I can use it to accomplish this I'd be thrilled. Please let me know how to do this with Win32Lib if it's possible. Virtual B ----- Original Message ----- From: Derek Parnell <ddparnell at bigpond.com> Subject: Re: Custom Dialogs > > On Sun, 30 Mar 2003 22:27:06 -0800, Virtual B <behaviorself at netzero.net> > wrote: > > > > > Hi Bernie, > > > > Thanks for the input. I've been looking over the files you suggested, > > and > > I'm starting to get an idea of how it works > [snip] > > BTW, you can do want you want with win32lib, unless there is something I've > misunderstood in your request. Have you tried that library and/or do you > need examples? > > -- > > cheers, > Derek Parnell > > > > TOPICA - Start your own email discussion group. FREE! > > ---
5. Re: Custom Dialogs
- Posted by Greg Haberek <g.haberek at comcast.net> Mar 31, 2003
- 377 views
What you need to do is make a function that creates a new window: function createDialog() integer win_id, combo1_id, combo2_id, btn1_id, btn2_id win_id = create( Window, "Dialog", 0, {0.5,-160}, {0.5, -120}, 320, 240, 0 ) combo1_id = create( Combo, "", win_id, 10, 10, 100, 20, 0 ) combo2_id = create( Combo, "", win_id, 10, 40, 100, 20, 0 ) btn1_id = create( PushButton, "OK", win_id, 10, 70, 90, 30, 0 ) btn2_id = create( PushButton, "Cancel", win_id, 10, 110, 90, 30, 0 ) -- link some events: setHandler( win_id, w32HClose, routine_id("Dialog_Close_Handler") ) setHandler( combo1_id, w32HChange, routine_id("Combo1_Change_Handler") ) -- etc, etc, etc... return {win_id, combo1_id, combo2_id, btn1_id, btn2_id} end function When you are done with the dialog, call destroy(win_id) to delete the Window and its children, and free up the resources. Then simply create a wrapper: procedure startDialog() sequence ids ids = createDialog() -- make a new dialog openWindow( ids[1], Normal ) -- Modaless, since we need multiple windows open -- from here your event handlers take over -- keep in mind you should call destroy() from the w32HClose event for the main window -- to free up the resources end procedure ----- Original Message ----- From: Virtual B <behaviorself at netzero.net> To: EUforum <EUforum at topica.com> Sent: Monday, March 31, 2003 9:26 AM Subject: RE: Custom Dialogs Hi Jonas, Nothing to be sorry about. I don't consider it an interruption. I'd like to get any help I can from anyone who can help, so I very much appreciate your input. I've seen openDialog(), but unless I'm missing something it won't work for what I want to do. I need to have several dialogs open at the same time. From what I understand, openDialog() is modal, and won't open another dialog until the first one is closed. If I'm just not understanding how it works, please (anyone) feel free to let me know. Thanks, Virtual B Jonas Temple wrote: > Virutal B, > > Sorry to interrupt the conversation, but I've done this sort of thing > with Win32Lib. Here's roughly how I did it: > > 1. Create the dialog box as desired (I used Judith's IDE) > 2. Create a global function that invokes the dialog (i.e. - > getSomething()) > 3. In getSomething call openDialog() passing the top-most win32lib > window ID. openDialog() does not return until the window you passed to > the routine closes. Then just return whatever values you need to in > getSomething(). > > Here's an excerpt: > > > -------------------------------------------------------------------------------- > > > -- Window CMMain > constant CMMain = createEx( Window, "iSeries System Environment > Connection", 0, Default, Default, 330, 405, {WS_DLGFRAME, WS_SYSMENU}, > {WS_EX_DLGMODALFRAME} ) > constant ConnGC = createEx( Group, "", CMMain, 12, 8, 304, 168, 0, 0 ) > constant CMMainLT = createEx( LText, "Select a system name and click > Connect.", ConnGC, 20, 12, 268, 36, 0, 0 ) > constant CMMainCB = create( DropDownList, "", ConnGC, 64, 56, 152, 104, > 0 ) > constant ConnectPB = createEx( DefPushButton, "Connect to System", > ConnGC, 12, 96, 124, 28, 0, 0 ) > setEnable( ConnectPB, False ) > constant CancelPB = createEx( PushButton, "Cancel System", ConnGC, 148, > 96, 124, 28, 0, 0 ) > setEnable( CancelPB, False ) > constant EnvGC = createEx( Group, "", CMMain, 12, 188, 304, 180, 0, 0 ) > constant CMMainELT = createEx( LText, "Select an environment name and > click Connect.", EnvGC, 8, 16, 288, 36, 0, 0 ) > constant CMMainECB = createEx( DropDownList, "", EnvGC, 64, 56, 152, > 104, 0, 0 ) > setEnable( CMMainECB, False ) > constant EnvConPB = createEx( DefPushButton, "Connect to Env", EnvGC, > 12, 104, 124, 28, 0, 0 ) > setEnable( EnvConPB, False ) > constant EnvCanPB = createEx( PushButton, "Cancel Environment", EnvGC, > 148, 104, 124, 28, 0, 0 ) > setEnable( EnvCanPB, False ) > > Then I have a global open function: > > global function ecacm_open(atom sys_connect, atom env_connect, atom > sec_check) > atom rtn_code > sequence parms, option > object results > > rtn_code = 1 > > that eventually calls: > > . > . > . > openDialog(CMMain) > . > . > . > > and then I return some value: > > return rtn_code > end function. > > HTH, > > Jonas TOPICA - Start your own email discussion group. FREE!