Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Quick form
Message
 
 
To
23/10/2001 18:37:18
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00572149
Message ID:
00572408
Views:
40
>>>>>>>Hi everybody,
>>>>>>>
>>>>>>>When I need to create a form based on some table I use the following trick:
>>>>>>>
>>>>>>>1) I place table in DE (when I'm done, I remove it, because I always prefer to open them programatically).
>>>>>>>
>>>>>>>2) I drag and drop fields.
>>>>>>>
>>>>>>>3) I rename labels, fields, set autosize for labels to .t.
>>>>>>>
>>>>>>>4) I open form as a table and change classes from base classes to my classes.
>>>>>>>
>>>>>>>3 and 4 are tedious... I probably can adjust field mappings in Option/Tools, but I don't want to make them permanently, because my classes could change, etc.
>>>>>>>
>>>>>>>Do you know another trick to simply create forms?
>>>>>>>
>>>>>>>Thanks in advance.
>>>>>>
>>>>>>For 3 and 4 you could simply click on any control on form go to command window and run your nonregistered builder (or even write select block and execute) :
>>>>>>
>>>>>>aselobj(aForm,1)
>>>>>>aForm[1].Setall('Autosize',.T.)
>>>>>>etc
>>>>>>
>>>>>>Cetin
>>>>>
>>>>>Oops. I used this technique for grids, but haven't thought about using it here... I'll probably write a simple Builder to convert names, classes, etc.
>>>>
>>>>Are you sure that it is more work to remap the classes from time to time, then manually change them hacking the SCX?
>>>
>>>I don't know. I tried the following program, but it doesn't work:
>>>
>>>
>>>********************************************************************
>>>*  Description.......: FormBuilder
>>>*  Calling Samples...: 
>>>*  Parameter List....: 
>>>*  Created by........: Cetin Basoz 
>>>*  Modified by.......: Nadya Nosonovsky 10/23/2001 01:11:58 PM
>>>********************************************************************
>>>aselobj(aForm,1)
>>>for each oObj in aForm
>>> do case
>>>   case oObj.class = 'label'
>>>      oObj.class = 'wglabel'
>>>   case oObj.class = 'text'
>>>      oObj.class = 'wgtext'
>>>   endcase
>>>   *oObj.classlibrary = '..\commonwg\classes\wgcontrols.vcx'
>>>next
>>
>>CLASS is Read-Only property :((( So, this technique would not work, and I still have to hack :(
>
>Nadya,
>You were close. I fall into second category of Dragan's developers but believe me it doesn't take 3 days maybe 30 mins and reusable :)
>Yes class is readonly but you simply copy nondefault PEM, removeobject, addobject from your class and restore PEM.
>If we wouldn't use some commands why they ever existed - aselobj, readexpression, readmethod, writemethod, cloneobject etc:)
>Cetin

Your's and Dragan's responses gave me courage to try it tomorrow... I probably make backup copy of the form just in case :)
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform