Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Default Object
Message
De
20/10/2014 12:47:14
 
 
À
19/10/2014 14:44:57
Lutz Scheffler
Lutz Scheffler Software Ingenieurbüro
Dresden, Allemagne
Information générale
Forum:
Visual FoxPro
Catégorie:
Programmation Orientée Object
Titre:
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 8.1
Network:
SAMBA Server
Database:
Visual FoxPro
Application:
Desktop
Divers
Thread ID:
01609619
Message ID:
01609659
Vues:
58
Ah, yes, but the parsing need occur only once if done at runtime, and then stored in a form property. If you are creating the form dynamically from metadata, you would need to use this method.

Or you could do the parsing in design time, and put the property (path to the control) on the form permanently, if the form is static.

Hank

>Yes, only one. On this form there is only one. Enter from any other input object other then the grid works perfectly fine. :(
>
>Maybe you misunderstand. I have large containers and a lot of them. If I have the default object in the last one there is a lot of useless parsing. Also i parse all if there is no default object at all.
>
>Lutz
>
>>I seem to remember there can be only one Default object on a form. Ah, yes, here it is, from the helpfile:
>>
>>"Only one command button or OLE Container control on a form can be the default command button. When the Default property is set to true (.T.) for one command button or OLE Container control, it is automatically set to false (.F.) for all other command buttons or OLE Container controls on the form. You cannot create a default command button or OLE Container control in a toolbar."
>>
>>I think that solves the double-default issue for you.
>>
>>Hank
>>
>>
>>>Hank,
>>>
>>>thanks.
>>>
>>>I had this idea too - but if this is in the wrong container it needs a while. And it would run even if there is no such object.
>>>
>>>>I would recurse down the object tree from FORM, looking for commandbuttons as the base object, and check whether Default = .T. Alternatively, checking each object for whether it has a Default property and checking whether it is .T.
>>>>
>>>>Or am I missing something?
>>>>
>>>>Hank
>>>>
>>>>>Hi Folks,
>>>>>
>>>>>I look for an idea to figure out what object on a form is the default one, i.e. the one that has the DEFAULT property true
>>>>>
>>>>>Background:
>>>>>
>>>>>I have a rather tricky grid that recieves the Enter key and performs stuff. Sometimes just some internal blabla, sometimes it performs an action directly bound to the key.
>>>>>
>>>>>I think I can tetermine what of the above, but the problem is how to rise the default objects default action (Click) / or not. For the moment it's simply doing nothing with the default object
>>>>>
>>>>>the code in the grid's textbox looks
>>>>>
>>>>> DO CASE
>>>>>  CASE tnKeyCode = 13
>>>>>*<Enter>
>>>>>   NODEFAULT
>>>>>  CASE INLIST(tnKeyCode,5,24) AND tnShiftAltCtrl=0
>>>>>*<Up>,<Down>
>>>>>   .SETFOCUS()
>>>>>  CASE tnKeyCode = 27
>>>>>*<ESC>
>>>>>   NODEFAULT
>>>>>...
>>>>>
>>>>>
>>>>>If I compare with ESC I see no difference (even in the keypress stuff around objects keypress , since form is KeyPreview = .T.), this is checkes with SET COVERAGE.
>>>>>
>>>>>Both keys just differ in the way they run throug this case.
>>>>>
>>>>>After the keypress is ended, ESC raises the events that will end up with the Click of Cancel- object Enter just does nothing.
>>>>>
>>>>>Well, I can not figure that out. O.K. But then, how do I raise default objects Click?
>>>>>
>>>>>TIA
>>>>>
>>>>>Lutz
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform