Author |
Topic: Adding Combo Box (Read 875 times) |
|
hellomike
New Member
member is offline


Gender: 
Posts: 46
|
 |
Re: Adding Combo Box
« Reply #2 on: May 4th, 2015, 2:12pm » |
|
Maybe the confusion is dlg%....
So effectively: 'dlg%' is a pointer to a template determined by calling FN_newdialog() and '!dlg%' is a pointer to a dialog box which is determined by calling PROC_showdialog()
Is this a correct assumption?
Thanks
Mike
|
|
Logged
|
|
|
|
rtr2
Guest
|
 |
Re: Adding Combo Box
« Reply #3 on: May 4th, 2015, 3:27pm » |
|
on May 4th, 2015, 2:12pm, hellomike wrote:'!dlg%' is a pointer to a dialog box which is determined by calling PROC_showdialog() Is this a correct assumption? |
|
It's not a pointer. When the dialogue box is open (i.e. after you call PROC_showdialog() but before you call PROC_closedialog()) !dlg% contains its window handle. When the dialogue box is not open (i.e. before the call to PROC_showdialog() or after the dialogue box has been closed) !dlg% contains zero. So by examining !dlg% you can tell whether the dialogue box is open or not.
But I don't think it's terribly helpful to think in terms of dlg% and !dlg%, because they are implementation details specific to the BB4W libraries. Rather it's better to consider whether the dialogue box is closed (i.e. exists only as a template in memory) or open (i.e. has a window handle), because that's fundamental to Windows and would be useful knowledge if you were to move to another programming language.
Richard.
|
|
Logged
|
|
|
|
CharlesB
New Member
member is offline


Gender: 
Posts: 46
|
 |
Re: Adding Combo Box
« Reply #4 on: May 4th, 2015, 4:22pm » |
|
Thank you Richard, it is clear that I do not have an understanding of dialogue boxes. I was successful in composing some boxes, and was aware that the order of the code is important. But this is a handful to digest, and I thank you again for your consistent help.
In the meantime, the problem was "obvious" and you caught it immediately. It took a second to fix once I saw your point. Charles
|
| « Last Edit: May 4th, 2015, 5:15pm by CharlesB » |
Logged
|
|
|
|
rtr2
Guest
|
 |
Re: Adding Combo Box
« Reply #5 on: May 4th, 2015, 5:23pm » |
|
on May 4th, 2015, 4:22pm, CharlesB wrote:| But this is a handful to digest |
|
To rattle on again about a subject which has been discussed ad-nauseam here, this all relates to the absence of the GUILIB library.
When I originally wrote WINLIB2 (etc.) I made no concessions to the beginner. Because it was clear to me how dialogue boxes worked in Windows I assumed it would be clear to everybody else. So the library was written not with user-friendliness in mind, but as the most straightforward interface between BBC BASIC and the Windows API that I could think of.
This is the way I always approach things. I don't want BB4W to limit what you can do, so I prefer to implement relatively low-level interfaces to Windows. They may not be terribly easy to use, but they are flexible.
However it has become evident subsequently that not everybody 'gets' the Windows API, and what they would prefer to have is a simple, user-friendly way of creating dialogue boxes (etc.), even if as a result there are certain things that are difficult - or even impossible - to achieve. This is very much the approach taken by Liberty BASIC and LBB.
As a result I proposed a GUILIB library for BB4W which would provide such a user-friendly interface. I won't go over old ground again and bemoan the fact that this library never came to fruition, especially as it was the cause of much upset and complaint at the time (the old threads are still there for people to read).
So we are where we are. The only available method of creating dialogue boxes and other controls in BB4W requires a reasonable understanding of the way Windows works. Sorry.
Richard.
|
|
Logged
|
|
|
|
|