May 06, 2024, 08:20:00 PM

News:

Own IWBasic 2.x ? -----> Get your free upgrade to 3.x now.........


Info Only Update 05-01-2012

Started by LarryMc, May 01, 2012, 01:15:03 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

LarryMc

FYI
I'm currently working on the replacement for the Dialog Editor.

It will do WINDOWS and MDI FRAMES as well as DIALOGS.

The cryptic STYLE values will be replaced by the constants ; like @NOCAPTION|@HIDDEN but will remain checkbox options for the most part.

Additional controls will be added.

Because of the changes dlg files built and saved with the current (and previous) versions will not be compatible with the new version.

This would be a good time to make suggestions, if you have any.

Attached are very preliminary screenshots.

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

Bruce Peaslee

A minor thing: I prefer CreateDialog to CREATEDIALOG in my code for readability, but I can always use Replace All...
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

LarryMc

Quote from: peaslee on May 05, 2012, 05:43:36 PM
A minor thing: I prefer CreateDialog to CREATEDIALOG in my code for readability, but I can always use Replace All...
One of the compiler options is "Case Sensitive Compilation".
All the commands and constants in the source libraries for IWBasic are all CAPS.
If I change the case in anything I do it will break code where that compiler option has been used.
So, I have to leave it all caps.

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

Working on this new Dialog Editor (will be a Form Editor now since it does WINDOWS) is time consuming.
There are 24 dialogs involved.
One for each control type and one for the form itself.

I've had to research the style flags for each to determine what was missing, if anything, on the old property dialogs,  and what was needed for the controls that weren't currently existing.

I've modified the existing dialogs when I could and created the missing ones.

For the form dialog I have completed the message handler as well as the property load and save routines to set/read all the checkboxes and edit fields.

Tonight I start on the message handlers, load, and save routines for the 23 controls.

Boring.... but it's got to be done.

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

Finished the code for:
@BUTTON
@CLRBUTTON
@RGNBUTTON
@COMBOBOX

4 down and 19 to go

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

Completed code for
@CHECKBOX
@CUSTOM
@EDIT
@GROUP
@SCROLLBAR (Horizonal)
@LISTBOX

10 down and 13 to go

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

Alyce

Quote from: LarryMc on May 01, 2012, 01:15:03 PM

The cryptic STYLE values will be replaced by the constants ; like @NOCAPTION|@HIDDEN but will remain checkbox options for the most part.

...
This would be a good time to make suggestions, if you have any.


I hope you are saying that the code output will look like @NOCAPTION|@HIDDEN instead of a single number. That's one of the main reasons I never use the dialog editor.
-Alyce

billhsln

I agree with Alyce.  I would prefer the @NOCAPTION|@HIDDEN also.

Bill
When all else fails, get a bigger hammer.

LarryMc

QuoteI hope you are saying that the code output will look like @NOCAPTION|@HIDDEN instead of a single number.
That's exactly what I was trying to say.  I didn't like those single numbers either.

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

Bruce Peaslee

Very good, Larry.

And it's nice to see Alyce is still around.   :D
Bruce Peaslee
"Born too loose."
iTired (There's a nap for that.)
Well, I headed for Las Vegas
Only made it out to Needles

LarryMc

Completed code for
@LISTVIEW
@RADIOBUTTON
@RICHEDIT
@STATIC
@SCROLLBAR (Vertical)
@LISTBOX

16 down and 7 to go

1st screenshot shows property dialog for existing DIALOG Editor TREEVIEW
2nd screenshot shows property dialog for new FORM Editor TREEVIEW
3rd (in messagebox for testing purposes) shows STYLE flags output in new editor as opposed to
0x50800007 in the current editor
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Alyce

Thanks. Much better than the original single number style.
-Alyce

AdrianFox

Ditto to Alyce et al.  I wish I had 5 euros for every ten minutes or so I have previously messed about with dialog flags because I've never known what all those cryptic numbers meant, or if they really did do the things I was expected.   The change to the 'normal' flags will be a really big improvement!   Thanks for all your hard work on this!
Adrian Fox

LarryMc

Completed code for
@TABCONTROL
@SPINNER
@DTPICKER
@PROGRESS
@TRACKBAR (Horizonal)
@TRACKBAR (Vertical)
@CALENDAR

23 down and 0 to go  ;D

Now I will start work on the code generation part of the Form Editor.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

Brian

Good stuff, Larry - looking forward to see the next release!

Brian

LarryMc

In the existing dialog editor the id numbers are assigned starting with 1 as each control is added.
The new fom editor will do a little more.

1st, when the user creates a new form, they will give the form a name of their choice (w1, d1, win, dlg13, properties, main, etc).
2nd, as they add controls, the controls will automatically be given ID names. These names will contain the control type along with an index for that type.
So the 1st button added would be BUTTON1, the 2nd BUTTON2, etc. The 1st STATIC wouuld be STATIC1, and so on.
(Note: the user can change those names if they desire)

When the code is generated, each control ID will have the form name prepended to it so the first button would be, say, win_BUTTON1 (or win_Close if the user change the button ID name.).

Instead of assigning a numeric constant to each of the controls individually like:
CONST d1_BUTTON1 = 1
CONST d1_EDIT1 = 2
CONST d1_EDIT2 = 3

I chose to use the ENUM structure shown in the attached screenshot.
The name of the ENUM structure will be the form name with "_const" appended to it.
This way only the first control in the ENUM has a number assigned to it.  The rest are automatically assigned in sequential order.

With this scheme you only have to change one number to change them all in order to avoid a conflict.

The screenshot shows what the generated code will look like, so far.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

billhsln

Excellent choice.  Should make it much easier to work with and more appealing to the eyes.

Just my opinion.
Bill
When all else fails, get a bigger hammer.

LarryMc

A screenshot of the ENUM, the OPENWINDOW, and the CONTROL generated code.
Now working on form handler code
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library

LarryMc

Te following is the code generated for a window with one each of all the controls.
The 'create skeleton' option was selected.

WINDOW win

ENUM win_const
win_BUTTON1 = 100
win_CLRBUTTON1
win_RGNBUTTON1
win_STATIC1
win_CHECKBOX1
win_RADIO1
win_LISTBOX1
win_COMBO1
win_EDIT1
win_RICHEDIT1
win_HSCROLL1
win_VSCROLL1
win_LISTVIEW1
win_TREEVIEW1
win_GROUPBOX1
win_TABCTRL1
win_HTRACKBAR1
win_VTRACKBAR1
win_CALENDAR1
win_SPINNER1
win_PROGRESS1
win_DTPICK1
win_CUSTOM1
ENDENUM

OpenWindow win,0,0,596,394,@MINBOX|@MAXBOX|@SIZE|@CAPTION|@SYSMENU,0,"Form Designer Test",&win_handler
CONTROL win,@SysButton,"Button 1",15,6,60,25,0,win_BUTTON1
CONTROL win,@Button,"ClrBtn 1",15,36,60,25,0,win_CLRBUTTON1
CONTROL win,@RgnButton,"RgnBtn 1",18,67,60,25,0,win_RGNBUTTON1
CONTROL win,@Static,"Static 1",17,99,60,25,0,win_STATIC1
CONTROL win,@Checkbox,"Checkbox 1",14,130,60,25,0,win_CHECKBOX1
CONTROL win,@Radiobutton,"Radio 1",17,159,60,25,0,win_RADIO1
CONTROL win,@Listbox,"Listbox 1",11,184,75,100,0,win_LISTBOX1
CONTROL win,@Combobox,"Combobox 1",87,8,60,100,0,win_COMBO1
CONTROL win,@Edit,"Edit 1",88,112,75,25,@CTEDITAUTOH,win_EDIT1
CONTROL win,@RichEdit,"RichEdit 1",91,147,100,100,@CTEDITMULTI|@CTEDITAUTOH|@CTEDITAUTOV|@BORDER,win_RICHEDIT1
CONTROL win,@Scrollbar,"",91,252,100,25,@CTSCROLLHORIZ,win_HSCROLL1
CONTROL win,@Scrollbar,"",159,10,25,100,@CTSCROLLVERT,win_VSCROLL1
CONTROL win,@ListView,"Listview 1",197,10,75,100,@LVSREPORT|@BORDER,win_LISTVIEW1
CONTROL win,@Treeview,"Treeview 1",199,118,75,100,@TVSLINESATROOT|@TVSHASBUTTONS|@TVSHASLINES,win_TREEVIEW1
CONTROL win,@Groupbox,"Groupbox 1",199,223,100,100,0,win_GROUPBOX1
TabControl win,284,11,160,50,@TCS_HOTTRACK|@TCS_RIGHTJUSTIFY|@TCS_MULTILINE,0,win_TABCTRL1
TrackBarControl win,284,66,130,35,@TBS_AUTOTICKS|@TBS_FIXEDLENGTH|@BORDER,0,win_HTRACKBAR1
TrackBarControl win,284,112,35,130,@TBS_AUTOTICKS|@TBS_FIXEDLENGTH|@TBS_VERT|@BORDER,0,win_VTRACKBAR1
CalendarControl win,389,109,199,185,@BORDER,0,win_CALENDAR1
SpinnerControl win,469,16,19,50,0,0,win_SPINNER1
ProgressControl win,18,289,130,35,@BORDER,0,win_PROGRESS1
DateTimePicker win,"DTPick 1",306,251,75,25,@BORDER|@DTS_SHOWNONE,0,win_DTPICK1
CONTROLEX win,"*need class*","CUSTOM 1",314,287,60,40,0,0,win_CUSTOM1

SUB win_handler(), INT
SELECT @MESSAGE
CASE @IDCREATE
CENTERWINDOW win
/* Initialize any controls here */
CASE @IDCONTROL
SELECT @CONTROLID
CASE win_BUTTON1
IF @NOTIFYCODE = 0
'*button clicked*'
ENDIF
CASE win_CLRBUTTON1
IF @NOTIFYCODE = 0
'*button clicked*'
ENDIF
CASE win_RGNBUTTON1
IF @NOTIFYCODE = 0
'*button clicked*'
ENDIF
CASE win_CHECKBOX1
IF @NOTIFYCODE = 0
'*button clicked*'
ENDIF
CASE win_RADIO1
IF @NOTIFYCODE = 0
'*button clicked*'
ENDIF
CASE win_LISTBOX1
'* respond to control notifications here *'
CASE win_COMBO1
IF @NOTIFYCODE = 0
'*button clicked*'
ENDIF
CASE win_EDIT1
'* respond to control notifications here *'
CASE win_RICHEDIT1
'* respond to control notifications here *'
CASE win_HSCROLL1
'* respond to control notifications here *'
CASE win_VSCROLL1
'* respond to control notifications here *'
CASE win_LISTVIEW1
'* respond to control notifications here *'
CASE win_TREEVIEW1
'* respond to control notifications here *'
CASE win_TABCTRL1
'* respond to control notifications here *'
CASE win_HTRACKBAR1
'* respond to control notifications here *'
CASE win_VTRACKBAR1
'* respond to control notifications here *'
CASE win_CALENDAR1
'* respond to control notifications here *'
CASE win_SPINNER1
'* respond to control notifications here *'
CASE win_PROGRESS1
'* respond to control notifications here *'
CASE win_DTPICK1
'* respond to control notifications here *'
CASE win_CUSTOM1
'* respond to control notifications here *'
ENDSELECT
CASE @IDCLOSEWINDOW
CLOSEWINDOW win
ENDSELECT
RETURN 0
END SUB


Note the quoted strings:
'*button clicked*'

The existing dialog editor created that as:
/*button clicked*/

I always hated the use of /**/ in this case because it messes things up if you want to comment out a section of code and it includes one of these lines.

Something else that I made different.
In the existing editor, each time you click 'generate code' you have to click 'skeleton' and 'to file' EVERY time, if you want those options.
I made the new editor remember your selections during a session of the IDE.

I've been working on the form editor basically as a stand alone program.
Now I will begin the process of merging it into the IDE itself.
When I finish that I will post another version of the new IDE.
LarryMc
Larry McCaughn :)
Author of IWB+, Custom Button Designer library, Custom Chart Designer library, Snippet Manager, IWGrid control library, LM_Image control library