News:

PlayBASIC2DLL V0.99 Revision I Commercial Edition released! - Convert PlayBASIC programs to super fast Machine Code. 

Main Menu

VB6 Form to Flexi Conversion

Started by kevin, December 17, 2012, 07:17:19 PM

Previous topic - Next topic

kevin

VB6 Form to Flexi Form Conversion

     This topic originated out of the recent PlayMAPPER update discussions, as such in this thread we're joining a conversion in progress.  You can check out where this came from here PlayMapper - Dialog Conversion Stuff


  Related Articles:

      *  Flexi Windows / GUI Original Work in progress.



 PlayMapper - Menu / Dialog Conversion

   The project is simmering along,  since last time all the menu stuff has been hooked up and pretty much most of the legacy WinGUI stuff removed.  Been able to strip it all back to about 20K lines, and pretty happy with that.  There's  seems to be  a reasonable amount of  legacy code that could be removed also.    The program uses a much older version of the Flexi library (whatever revision it was back in 2008).   Flexi's had various key additions since then,  most to how it works, such as call backs to user defined functions and stuff like support for the treating the screen as special window.    They're both very handy, the latter removes a big part of the 'click' and focus issues from multi windowed apps.  

    So my first port of call has been swap to the most recent addition of flexi, this is where all the parts collide.  Current all dialogs are hand programmed in PlayMAPPER.  Building everything in code is tedious.. very tedious.. Since the newer version of Flexi support call backs,  it'd be much easier to define the form in VB6 and run the importer app and have it spit out the required data/code.   Doing this means translating the parsed form /control dialog info into Flexi gadgets.  Flexi wasn't meant to be map to Windows GUI one to one, so something won't translate over.   But ideally the closer the better.      

    In today's little experiment, we're importing the VB6 form, then  building a working flexi window with controls from it.  The styling is different, but the basic functionality is much the same.  What's missing the behaviors behind the interactions with the Clicking the various gadgets.  These will have to be programmed, much as they are in VB.   But If with the call back system, it should be possible to stream line much of this code.    But anyway, bellow we have piccy of the VB6 form editor and flexi window next to it.  




PlayMapper / GUI code generation

   Pretty busy this time of year with real life stuff (as is everybody), so just been trying to drop some time into various code banks.   Which means adding some updates to Flexi / the Menu stuff and VB6 form parser stuff.   The updating editions of flexi include call backs, where all the old code in the PlayMAPPER requires manual event sniffing.   Meaning dialogs are set up in code, with actions dropped into the event catcher.   So there's a lot of code in the program that has little, if nothing to do with mapping code, as it's just GUI related.   The logical solution would be shift everything to call backs, but there's still a lot of tweaking required, and you can't control the form layout.

   Obviously, to get around the manual creation stuff  the form builder approach is the best workable option on the table today.  I've been messing around with an export process for VB6 importer.   The current test exports simple text file of the imported controls with properties.   I could stop there really, make a parser and create the window from the control stack.   But it makes more sense to have the export build the PlayBASIC code for the form also.    Where it creates an assume event list and set of back end functions for the dailog  

   So the above form becomes this.  



--------------------------------------------------------------------------------
;GUI Form [PROJECT_PROPERTIES] Properties
;Created: 18 Dec 2012
;--------------------------------------------------------------------------------

FORM
PROJECT_PROPERTIES
Xpos=0
Ypos=0
Width=856
Height=636
Appearence=1
Visible=1
Caption=This is my forms name
BackColour=$00FF8080
EventList==PROJECT_PROPERTIES_MouseOver,

CHECKBOX
PROJECT_PROPERTIES_Check2
Xpos=272
Ypos=352
Width=145
Height=25
Appearence=1
Visible=1
Value=$00000001
Caption=Check2
BackColour=$00ECE9D8
Alignment=1
EventList=onleftclick=PROJECT_PROPERTIES_Check2_OnLeftClick

CHECKBOX
PROJECT_PROPERTIES_Check1
Xpos=272
Ypos=320
Width=145
Height=25
Appearence=1
Visible=1
Value=$00000001
Caption=Check1
BackColour=$00ECE9D8
EventList=onleftclick=PROJECT_PROPERTIES_Check1_OnLeftClick

HSCROLLBAR
PROJECT_PROPERTIES_HScroll1
Xpos=24
Ypos=592
Width=433
Height=17
ScrollerMin=4
ScrollerMax=100
ScrollerLargeChange=1
Appearence=1
Visible=1
Value=$00000004
BackColour=$00ECE9D8
EventList=onclick=PROJECT_PROPERTIES_OnClick

VSCROLLBAR
PROJECT_PROPERTIES_VScroll1
Xpos=456
Ypos=304
Width=17
Height=289
ScrollerMin=123
ScrollerMax=22222
ScrollerLargeChange=1
Appearence=1
Visible=1
Value=$0000007B
BackColour=$00ECE9D8
EventList=onclick=PROJECT_PROPERTIES_OnClick

TEXTBOX
PROJECT_PROPERTIES_Text1
Xpos=288
Ypos=128
Width=225
Height=69
Text=Single Line Textbox
Appearence=1
Visible=1
BackColour=$00FFFFFF
Alignment=2
EventList=HitEnter=_HitEnter

COMMANDBUTTON
PROJECT_PROPERTIES_Command1
Xpos=376
Ypos=40
Width=129
Height=65
Appearence=1
Visible=1
Caption=Button
BackColour=$00ECE9D8


PICTUREBOX
PROJECT_PROPERTIES_Picture2
Xpos=40
Ypos=296
Width=189
Height=261
Appearence=1
Visible=1
EventList==PROJECT_PROPERTIES_Picture2_MouseOver

PICTUREBOX
PROJECT_PROPERTIES_Picture1
Xpos=96
Ypos=16
Width=173
Height=133
Appearence=1
Visible=1
BackColour=$00FF8000
EventList==PROJECT_PROPERTIES_Picture1_MouseOver

IMAGE
PROJECT_PROPERTIES_Image1
Xpos=584
Ypos=8
Width=808
Height=634
Appearence=1
Visible=1
EventList==PROJECT_PROPERTIES_Image1_MouseOver

LABEL
PROJECT_PROPERTIES_Label3
Xpos=288
Ypos=256
Width=249
Height=25
Appearence=1
Visible=1
Caption=This is centered label
BackColour=$00C04000
InkColour=$00C0C0C0
Alignment=2


LABEL
PROJECT_PROPERTIES_Label2
Xpos=32
Ypos=256
Width=249
Height=25
Appearence=1
Visible=1
Caption=This is another label
BackColour=$00C04000
InkColour=$00C0C0C0
Alignment=1


LINE
PROJECT_PROPERTIES_Line1
X1Y1X2Y2=24,56,88,192
Appearence=1
Visible=1
InkColour=$000000FF


LABEL
PROJECT_PROPERTIES_Label1
Xpos=32
Ypos=224
Width=249
Height=25
Appearence=1
Visible=1
Caption=This is a label
BackColour=$00C04000
InkColour=$00C0C0C0




  and the code generator creates this.    

PlayBASIC Code: [Select]
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; --- [PROJECT_PROPERTIES Defines ]--------------
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------

Type PROJECT_PROPERTIES_Structure
Window
Gadget_Check2
Gadget_Check1
Gadget_HScroll1
Gadget_VScroll1
Gadget_Text1
Gadget_Command1
Gadget_Picture2
Gadget_Picture1
Gadget_Image1
EndType


Dim PROJECT_PROPERTIES as PROJECT_PROPERTIES_Structure


; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; --- [PROJECT_PROPERTIES ]--------------
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------

Psub PROJECT_PROPERTIES_Create(ThisObject,EventIndex)
#print "PROJECT_PROPERTIES->CREATE"

Dim PROJECT_PROPERTIES as PROJECT_PROPERTIES_Structure

EndPsub


Psub PROJECT_PROPERTIES_Delete(ThisObject,EventIndex)
#print "PROJECT_PROPERTIES->DELETE"


EndPsub


Psub PROJECT_PROPERTIES_OnClick(ThisObject,EventIndex)
#print "PROJECT_PROPERTIES->ONCLICK"


EndPsub


Psub PROJECT_PROPERTIES_MouseOver(ThisObject,EventIndex)
#print "PROJECT_PROPERTIES->MOUSEOVER"


EndPsub


; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; --- [PROJECT_PROPERTIES_Check2 ]--------------
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------

Psub PROJECT_PROPERTIES_Check2_OnLeftClick(ThisObject,EventIndex)
#print "PROJECT_PROPERTIES_Check2->ONLEFTCLICK"


EndPsub


; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; --- [PROJECT_PROPERTIES_Check1 ]--------------
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------

Psub PROJECT_PROPERTIES_Check1_OnLeftClick(ThisObject,EventIndex)
#print "PROJECT_PROPERTIES_Check1->ONLEFTCLICK"


EndPsub


; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; --- [PROJECT_PROPERTIES_HScroll1 ]--------------
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------

Psub PROJECT_PROPERTIES_HScroll1_OnClick(ThisObject,EventIndex)
#print "PROJECT_PROPERTIES_HScroll1->ONCLICK"


EndPsub


; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; --- [PROJECT_PROPERTIES_VScroll1 ]--------------
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------

Psub PROJECT_PROPERTIES_VScroll1_OnClick(ThisObject,EventIndex)
#print "PROJECT_PROPERTIES_VScroll1->ONCLICK"


EndPsub


; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; --- [PROJECT_PROPERTIES_Text1 ]--------------
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------

Psub PROJECT_PROPERTIES_Text1_HitEnter(ThisObject,EventIndex)
#print "PROJECT_PROPERTIES_Text1->HITENTER"


EndPsub


; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; --- [PROJECT_PROPERTIES_Picture2 ]--------------
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------

Psub PROJECT_PROPERTIES_Picture2_OnClick(ThisObject,EventIndex)
#print "PROJECT_PROPERTIES_Picture2->ONCLICK"


EndPsub


Psub PROJECT_PROPERTIES_Picture2_MouseOver(ThisObject,EventIndex)
#print "PROJECT_PROPERTIES_Picture2->MOUSEOVER"


EndPsub


; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; --- [PROJECT_PROPERTIES_Picture1 ]--------------
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
Login required to view complete source code



      All this does, is create a shell of behaviors from various common interactions with each control on the form.   When the loader parsers the form text from above, it passes the EventList field from each control to the Flexi event parser, which locates the functions and initializes the behaviors inside the windows/gadget control.     So when you click a button called "HelloWorld"  it'd call the HelloWorld_OnCLick function.      The only thing missing so far is way for the Create action to map the childs gadgets into the forms structure.   Which is handy for when you need to get properties from the form when it closes.  

     



kevin


One Click Export

        Most of the sessions for this have been focusing around the GUI requirements, which can be something of a pretty big disincentive when writing new or updating  legacy tools.   The last session moved the import/designer model forward significantly, getting to a point where it can save out all required framework to disc, but not reload it.   Knocking together a loader/parser to pick through the form defines was simple enough, but there was still one thing bugging me.   Which was how the form loader would remember the gadget handles during startup.     

        Loading a form is two pass process.  First we parse the definitions into a common control stack, once loaded we run through those and build a flexi version of that data.   The exporter also creates some PB code to represent the dailog.   This is just a structure with a bunch of fields repenting the controls we might be interested in interacting with.   Generally when a form loads you end up piping the data you want into the control from some external place, then when the user closes the form(or while they edit it) you end up updating those fields.   So getting those control defined in the structure up front is handy.  Could add ON CReate functions for each control, but that's a lot  more code per window, for what what should be pretty straight forward.   The easy solution turned out be splitting the TYPE into a Main and Gadget type.   

       Like this,

PlayBASIC Code: [Select]
   Type PROJECT_PROPERTIES_Gadget_Structure
Command2
Check2
Check2_Label
Check1
Check1_Label
HScroll1
VScroll1
Text1
Command1
Picture2
Picture1
Image1
EndType


Type PROJECT_PROPERTIES_Structure
Window
Gadget as PROJECT_PROPERTIES_Gadget_Structure
EndType

Dim PROJECT_PROPERTIES as PROJECT_PROPERTIES_Structure




      In the create FLEXI from gui control stack function, the function is passed a general pointer of the Gadget field  (PROJECT_PROPERTIES.Gadget).    It's a general pointer as the loader has no idea about the structures fields,  it's just assuming all the memory it's looking at is in the same order of the fields,  which that will be,  provided they're created from the same source form.    So what we get is load function that imports the definitions, creates the flexi representation of the form and initializes the forms type structure all by itself. 

      The exporter is currently only suited to the single instance dialogs, meaning only one version of the form can be open at any one time.  Multi instance isn't a big deal, we'd  just need to query the parent of the control the user is interacting inside the callback.   The user could store the index/pointer whatever of the data structure this window (and it's controls) belongs to.   Which makes for a bit more code in event call backs, but it's not rocket science.


kevin

#2
 One Stop Shop Of GUI Creation ?? Not Yet, But Maybe One Day
   
     Finally getting back on the programming horse again and have made some  good headway with VB6 form conversion tool.   It's been working now for a while, but it's the extras that will make it more desirable way of creating  GUI based apps in the future.   So getting the parser to understands as many useful properties from the source form as possible is very desirable.   The exporter creates the simplified representation of the various gadgets properties as text file and also makes a code template of common event code from such a window.

     The conversion is one half of the process, the other is the common library to load the definitions back in.  In this version i'm using FlexiGUI, so the loader includes the load and creation code to set the window as per the definitions.    Which all works wonderfully well in the tests, but how well it's goes in the real world is anybodies guess.   One thing I see as being an issue would be if the user change the VB form and had to convert it again.   This is an issue as you'd have to wedge your code into the updated code template each time..    Which kinda feels like swapping one painful problem for another even more painful problem.    I think it might be possible to make a code 'updater' routine that runs through the newly created  template and compares it against the current one in the user target playbasic project.  Which would great when it works, but obviously a tad risky when trying to live modify user code.

     Forgetting that problem for a moment,  the current drama i'm having is that flexi only supports child windows, it doesn't support child gadgets.   Which  has become something of an annoying  issue when implementing a FRAME which acts as container.  Was going to cheat and make any framed gadgets a child window, but it doesn't seem to want to work..  Well, it works to a degree but any attached gadgets to the frame window won't draw...  All the good old fashion fun stuff...  

     Bellow is piccy of VB6 window and flexi representation of it with example out from the editor attached.  

kevin

#3
 Framing it up

    Getting frames working has been a tangle,  the GUI library just isn't really set up to handle them as they appear in VB, so there more a simulation.    Last time I'd been trying to make child windows into an overlaid form.  Which would give much the same result as VB, but the parent/child hierarchy of Flexi doesn't really support it.  It's be possible to hack something together, but the quicker solution was to add a frame gadget type.   The gadget is really nothing more than a picture with the frame drawn around the edges.   The difference occurs because other gadgets just sit on top of it, they're not owned by the frame.    So if you move the frame, none of the children move with it.    

    Adding the frame gadget actually revealed another issue with the text box gadget (which has a lot of dramas).  The problem occurs when two gadgets over lap, such as the text box sitting over the frame gadget.  When the text box was in focus it'd stopped refreshing if the mouse left that region.   Normally when a textbox is selected the gadget would still receive text input regardless of where the mouse is, but it didn't.  Which just took a bit tweaking rearranging in Flexi.  

    The sizing has also been tweaked up, so the gadget sizes are a little more like the VB version making it a better representation of the original.

kevin


Adding Option Button Gadget Support

      It's been way too hot for programming today, so tonight I've been tweaking the gadget support in flexi some more with the addition of an OptionButton / RadioButton.   They're much like Check boxes really, expect circular in appearance and used where the user must section one of many options.    Adding new gadgets can be a tricky in flexi as there's a number of situations for the gadget to aware of.  Since the check box supports hover highlighting,  then OptionButton also does.  Which of course is the only thing that's not working for whatever reason.   You can click and change the state, but when you leave the gadget it remains highlighted.    Bit of a pain, but there's bound to be some simple explanation hidden away in the redraw code.   

      This is one area where the Action GUI model would be easier.    Ideally the 'core' gui could be broken up into the management and theme side, not only making it a lot more visually flexible, but it would allow 3rd party gadgets to be that same as native gadgets.   

     Anyway, here's this morning 'as it happens' picture...


kevin

#5
Option Button Continued

     Support for Option Button was added last week.   Had a few drama's with rendering the control, but just needed to tag the gadget correctly for refresh and it goes away.    Option Buttons work in groups/arrays, where the GUI manages the states of all buttons in the same group.   So when you click or set an option to true, this turns the others off.  So they're a singular selection.   In VB you create different groups either by creating control arrays or using the hierarchy of a frame.    The latter is not supported in flexi, so the only way to make them work is using an array.        The import parser detects controls that belong to a same array group and tags them with a unique group ID and Index.   This allows us to differentiate between different sets controls and controls within the same array.

     Loading the controls is one part of the puzzle the other issue was getting the code builder to spit out.   Since the options act as a group, the easiest option was to make unique names for the 'action' functions.  So trap when the state of an option has change we just slab the code we want inside the template function.     Flexi update call 'onchange' event for it's siblings also.     So the generators spits out a working back end template of code for the form.  There's probably potential for the order of operation faults, but ya get that.

     The only drama I'm actually having with it, is there appears to be fault where the subsequent forms that are translated, end up with the form name doubled up.  Noticed it before, but assumed it was the result of previously used variable.  But after looking that doesn't seem to be the problem.  Been sifting through it for the a couple of days now and no closer to the smoking gun.    I can make it work by changing this particular section of the code, but it should work as is.   So this morning I've been sifting through the disassembles of if, looking for any 'odd' instructions that might be the cause, but so far it all looks fine.    Not too sure where the cause actually is..  what fun.



;--------------------------------------------------------------------------------
;GUI Form [MAKE_CUBE_DIALOG] Properties
;Created: 24,Jan,2013
;--------------------------------------------------------------------------------

FORM
MAKE_CUBE_DIALOG
Width=288
Height=296
Appearence=1
Visible=1
Caption=Create Cube
BackColour=$00ECE9D8
StartUpPosition=3
Moveable=1
EventList=OpenWindow=MAKE_CUBE_DIALOG_OpenWindow,DeleteWindow=MAKE_CUBE_DIALOG_DeleteWindow,OnClick=MAKE_CUBE_DIALOG_OnClick,MouseOver=MAKE_CUBE_DIALOG_MouseOver


COMMANDBUTTON
MAKE_CUBE_DIALOG_CANCEL_BUTTON
Xpos=8
Ypos=264
Width=81
Height=25
ParentIndex=1
Appearence=1
Visible=1
Caption=Cancel
BackColour=$00ECE9D8
EventList=OnClick=MAKE_CUBE_DIALOG_CANCEL_BUTTON_OnClick


COMMANDBUTTON
MAKE_CUBE_DIALOG_CREATE_BUTTON
Xpos=200
Ypos=264
Width=81
Height=25
ParentIndex=1
Appearence=1
Visible=1
Caption=Create
BackColour=$00ECE9D8
EventList=OnClick=MAKE_CUBE_DIALOG_CREATE_BUTTON_OnClick


FRAME
MAKE_CUBE_DIALOG_FRAME1
Xpos=8
Ypos=8
Width=273
Height=249
ParentIndex=1
Appearence=1
Visible=1
Caption=Frame1
EventList=OnClick=MAKE_CUBE_DIALOG_FRAME1_OnClick


OPTIONBUTTON
MAKE_CUBE_DIALOG_OPTION1
Xpos=48
Ypos=160
Width=105
Height=17
ParentIndex=4
ArrayGroupID=1
ArrayGroupIndex=2
Appearence=1
Visible=1
Caption=BUtton #3
BackColour=$00ECE9D8
EventList=SingleMouseClick=MAKE_CUBE_DIALOG_OPTION1_Index2_SingleMouseClick, OnChange=MAKE_CUBE_DIALOG_OPTION1_Index2_OnChange


OPTIONBUTTON
MAKE_CUBE_DIALOG_OPTION1
Xpos=48
Ypos=144
Width=105
Height=17
ParentIndex=4
ArrayGroupID=1
ArrayGroupIndex=1
Appearence=1
Visible=1
Caption=Button #2
BackColour=$00ECE9D8
EventList=SingleMouseClick=MAKE_CUBE_DIALOG_OPTION1_Index1_SingleMouseClick, OnChange=MAKE_CUBE_DIALOG_OPTION1_Index1_OnChange


OPTIONBUTTON
MAKE_CUBE_DIALOG_OPTION1
Xpos=48
Ypos=128
Width=105
Height=17
ParentIndex=4
ArrayGroupID=1
Appearence=1
Visible=1
Caption=Button #1
BackColour=$00ECE9D8
Alignment=1
EventList=SingleMouseClick=MAKE_CUBE_DIALOG_OPTION1_Index0_SingleMouseClick, OnChange=MAKE_CUBE_DIALOG_OPTION1_Index0_OnChange


CHECKBOX
MAKE_CUBE_DIALOG_CHECK1
Xpos=96
Ypos=64
Width=89
Height=17
ParentIndex=4
Appearence=1
Visible=1
Caption=Check1
BackColour=$00ECE9D8
EventList=SingleMouseClick=MAKE_CUBE_DIALOG_CHECK1_SingleMouseClick, OnChange=MAKE_CUBE_DIALOG_CHECK1_OnChange


TEXTBOX
MAKE_CUBE_DIALOG_TEXT1
Xpos=96
Ypos=24
Width=121
Height=19
Text=CUBE
ParentIndex=4
Appearence=1
Visible=1
BackColour=$00FFFFFF
EventList=HitEnter=MAKE_CUBE_DIALOG_TEXT1_HitEnter


LABEL
MAKE_CUBE_DIALOG_LABEL1
Xpos=40
Ypos=24
Width=49
Height=17
ParentIndex=4
Appearence=1
Visible=1
Caption=Name:
Alignment=1




Generated GUI template code

PlayBASIC Code: [Select]
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; ---[ MAKE_CUBE_DIALOG Defines ]--------------
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------

Type MAKE_CUBE_DIALOG_Gadget_Structure
CANCEL_BUTTON
CREATE_BUTTON
FRAME1
OPTION1_Index2
OPTION1_Index2_Label
OPTION1_Index1
OPTION1_Index1_Label
OPTION1_Index0
OPTION1_Index0_Label
CHECK1
CHECK1_Label
TEXT1
EndType


Type MAKE_CUBE_DIALOG_Structure
Window
Gadget as MAKE_CUBE_DIALOG_Gadget_Structure
EndType


Dim MAKE_CUBE_DIALOG as MAKE_CUBE_DIALOG_Structure


; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; ---[ MAKE_CUBE_DIALOG ]--------------
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------

Psub MAKE_CUBE_DIALOG_LoadForm(FormName$)
#print "MAKE_CUBE_DIALOG->LOADFORM"

Dim MAKE_CUBE_DIALOG as MAKE_CUBE_DIALOG_Structure
ThisWindow=Flexi_LOAD_FORM(FormName$,MAKE_CUBE_DIALOG.Gadget)
if ThisWindow
MAKE_CUBE_DIALOG.window=ThisWindow
endif

EndPsub ThisWindow


Psub MAKE_CUBE_DIALOG_OpenWindow(ThisObject,EventIndex)
#print "MAKE_CUBE_DIALOG->OPENWINDOW"


EndPsub


Psub MAKE_CUBE_DIALOG_DeleteWindow(ThisObject,EventIndex)
#print "MAKE_CUBE_DIALOG->DELETEWINDOW"


EndPsub


Psub MAKE_CUBE_DIALOG_OnClick(ThisObject,EventIndex)
#print "MAKE_CUBE_DIALOG->ONCLICK"


EndPsub


Psub MAKE_CUBE_DIALOG_MouseOver(ThisObject,EventIndex)
#print "MAKE_CUBE_DIALOG->MOUSEOVER"


EndPsub


Psub MAKE_CUBE_DIALOG_CANCEL_BUTTON_OnClick(ThisObject,EventIndex)
#print "MAKE_CUBE_DIALOG_CANCEL_BUTTON->ONCLICK"


EndPsub


Psub MAKE_CUBE_DIALOG_CREATE_BUTTON_OnClick(ThisObject,EventIndex)
#print "MAKE_CUBE_DIALOG_CREATE_BUTTON->ONCLICK"


EndPsub


; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; ---[ MAKE_CUBE_DIALOG_FRAME1 ]--------------
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------

Psub MAKE_CUBE_DIALOG_FRAME1_OnClick(ThisObject,EventIndex)
#print "MAKE_CUBE_DIALOG_FRAME1->ONCLICK"


EndPsub


; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; ---[ MAKE_CUBE_DIALOG_OPTION1_Index2 ]--------------
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------

Psub MAKE_CUBE_DIALOG_OPTION1_Index2_SingleMouseClick(ThisObject,EventIndex)
#print "MAKE_CUBE_DIALOG_OPTION1_Index2->SINGLEMOUSECLICK"


EndPsub


Psub MAKE_CUBE_DIALOG_OPTION1_Index2_OnChange(ThisObject,EventIndex)
#print "MAKE_CUBE_DIALOG_OPTION1_Index2->ONCHANGE"


EndPsub


; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; ---[ MAKE_CUBE_DIALOG_OPTION1_Index1 ]--------------
; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------

Psub MAKE_CUBE_DIALOG_OPTION1_Index1_SingleMouseClick(ThisObject,EventIndex)
#print "MAKE_CUBE_DIALOG_OPTION1_Index1->SINGLEMOUSECLICK"


EndPsub


Psub MAKE_CUBE_DIALOG_OPTION1_Index1_OnChange(ThisObject,EventIndex)
#print "MAKE_CUBE_DIALOG_OPTION1_Index1->ONCHANGE"


EndPsub


; -----------------------------------------------------------------------------
; -----------------------------------------------------------------------------
; ---[ MAKE_CUBE_DIALOG_OPTION1_Index0 ]--------------
; -----------------------------------------------------------------------------
Login required to view complete source code



kevin

#6
Oh Dear... It Works....

     Haven't done much of anything recently, but getting back into the swing of some PlayBASIC tinkering today.   The issues that I'd been having with the export names in the previous versions of the conversion tool are now a thing of the past, thanks to V1.64O beta 1.   So now it'll export a folder of forms with expected results.   The builder imports->converts,  then loads the exported definitions, showing a representation of the form flexi.   Which gives an indication of what it looks like, but it can't test the dynamically created template code.   Since the template code is built at runtime and not prior to compile time.    The only way to do that would be have the builder set up a mock up project and compile it..  

     The build at runtime model, would allow the project to wedge dynamically created code into a preexisting template and compile & run that.  Which is pretty much how high level tools like VB work.   Where some pre compiled underlying frame work is calling into our code.   It's not really that complicated to do,  for this it'd be a novelty, but it's not hard to imagine situations where such a model would be useful in such things as building a Point and Click game maker.    

     Anyway, there's only few other controls that I might drop in some support for  out of the 1000's of available controls for VB, so obviously i'm going to bother supporting them.  Many are proprietary anyway.  

kevin

#7
  Just Click and Run

     One thing missing from the conversion routines was support for fonts.   Fonts are bit of a pain as the program has to build CRF representation of each unique font from each control.   I'd imagined this would slow the import conversion down a lot,  and it would if there's loads of custom fonts, but the default settings seem to barely make an impact on the time.   The export throws most of the font settings away and just keeps the name, it's original size and it's CRF name.  Storing them as CRF guarantees the same output on any windows system.  

     So after messing with fonts, tonight I've successfully had a go at making the conversion program export a test project and run it from the imported VB6 forms.  The project wedges the various code chunks created during conversion together, then runs them back through the compiler.   This means that all the template code can be tested before dragging those chunks of code into a new project.    The conversion process here is pretty trivial, but it's not that far fetched to imagine that entire (simple)  VB6 source codes could be converted if somebody put their mind to it.   Much like how the many VB6->C++ conversion tools work, which are mega bucks btw.     
     A tool like this might seem a tad obscure, but I see this as the way to speed up helper tool development without 3rd party dependencies, which has always been difficult.  It's not a magic solution though, there's still going to be some tedium when updating forms and having to manage refreshing the templates.  But that's the lesser of two evils I think.