Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
OptionGroups
Message
De
05/04/2001 22:40:26
 
 
À
05/04/2001 02:47:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
Divers
Thread ID:
00491722
Message ID:
00492653
Vues:
13
You know, I was thinking about this today, but I didn't get a chance to hook up and mention it. If you've already done it, oh, well... But if not, you might be better off adding a property to your base class - say 'ButtonCountVisible', and then in the program below, instead of changing the individual option groups' button counts, change the line so that 'ButtonCount =' becomes 'ButtonCountVisible ='. That way, you'll automatically default them all back to 10 (as the base class) while keeping their individual attributes. You can then code your base class init to use the ButtonCountVisible property to properly display the buttons and the group frame.

Alan

>Thanks Alan,
>
>Yes I will do this.
>I just don't like the idea that changing a baseclass can stop you even loading a form in form designer. :(
>
>Oh well.. better get started then!
>
>>Oh, yes, I almost forgot. BACKUP! BACKUP! BACKUP!
>>One other thing, this will work fine under normal conditions, but it just occurred to me that you might want to change the line that reads:
>>
>>if 'ButtonCount =' $ lcTempString
>>
>>to be:
>>
>>If Left(lcTempString, 13) == "ButtonCount ="
>>
>>It might save some confusion in some oddball case.
>>
>>Alan
>>
>>>Automate!!
>>>
>>>use ADir() to fill an array with all your form names.
>>>set memowidth to 1000 so you don't have any wrap worries
>>>Loop through the array USEing each scx
>>>
>>>
>>>scan for class = 'youroptiongroup'  && all lower case
>>>  lcString = ""
>>>  lcTempString = ""
>>>  for lnCount = 1 to memlines(properties)
>>>     lcTempString = mline(properties, lnCount)
>>>     if 'ButtonCount =' $ lcTempString
>>>        lcTempString = StrTran(lcTempString, Substr(lcTempString, 15), "10")
>>>     Endif
>>>     lcString = lcString + lcTempString + Chr(13) + Chr(10)
>>>  EndFor
>>>  Replace properties with left(lcString, len(lcString) - 2)
>>>EndScan
>>>
>>>
>>>>Yes, what you suggest will work fine...
>>>>
>>>>But the main problem i'm having is if I have a form with a Optiongroup with 3 items in it and I change the baseclass to have 10 options
>>>>I can't load the form it gives an error... Basically I'm too late to change my baseclass.
>>>>
>>>>I need to go through all my forms (via .SCX) and make the buttoncount 10 before I can load them.
>>>>
>>>>Thanks for the suggestion though :)
>>>>
>>>>>How about instead of adding and removing option buttons, simply make the unused ones invisible and resize the option group frame. I do that in a particular instance, and it seems to work just fine.
>>>>>
>>>>>Alan
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform