Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VFP5 - Toolbars & Toolbar Icon Problems
Message
De
10/11/1998 12:17:04
Nancy Folsom
Pixel Dust Industries
Washington, États-Unis
 
 
À
10/11/1998 11:57:20
Bruce Gilmour
Cal-Mour Consultants
Calgary, Alberta, Canada
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00155593
Message ID:
00156222
Vues:
55
Bruce,
You are very patient! :-)

Yes, for the most part I agree. However, I would create the toolbar visually in the class designer. Especially given Michel's need to really control the layout.

As for createobject and addobject: I'm not Jim Booth or Tamar Granor--but here's what I understand about CreateObject and Addobject.

I can define an application class and add a custom property to it called, say, o_user. My intention is that after a user successfully logs into the application, they're information (rights, etc) is stored in the application object for use throughout the system.

Then to login my user I can do this:
oApp.o_user = CREATEOBJECT( 'Login' )
IF !ISNULL( oApp.o_user )
  *!* then they remembered their password :) and everything is okay to proceed.
ELSE
  *!* they lost their little yellow sticky where they kindly leave their password for all the world to see :)
ENDIF
Now, say I have a special application level object that I don't know if I'll create or not...It depends on the life of the app object. I won't want to have custom property for it. So, I would want to:
oApp.AddObject( 'o_SpecialThing', 'SomeRazamadazObject' )
Now, it's interesting. When I was working on this originally, it seemed to me that I could createobject a form, say, assigning it to a container's custom property when it is illegal to AddObject that same object to the container. Now, there could have been any number of things that I was doing wrong, but what I decided was that if I was getting confused conceptionally while I was working on it, I didn't have a hope of being able to maintain it. So, sometimes I'll choose a route that is conceptually "clean" to me even it isn't necessarily the most efficient way to do it. Vis-a-vis, using a formset for an application object. Which, to me makes good conceptual sense, and I'm not as likely to run into a brick wall maintaining object properties. < shrug > At least, that was my thinking at the time. That was just my first app object!

Now I really don't have the same trouble using a line class as a base class for most anything.


>Very coherent. I don't know what the underlying difference is between CREATOBJECT and ADDOBJECT (Edward probably knows all these things *G*) so I don't know when one should be used over the other or CAN be used over the other.
>
>However, that aside, i can now apreciate where you were heading in regards to Michel's problem. As I now understand it, you and I seem to be headed in the same direction with the only difference being the base object class. The toolbar would still be created in code within the base object. Right?
>
>>No offense taken at all, Bruce. As I said, I was just musing. And, despite what the blue envelope may imply, I'm learning as I go, too :-) I also CREATEOBJECT my app object. But when other objects are created, I want to ADDOBJECT them to the app object.
>>
>>In my just-departed-job I retrofitted an application object over the top of a two-year old 3.0 app. There was a LOT of very nasty code in it--just learning kinds of things and inherited, too. So, I ended up defining a app class that was based on a formset. I couldn't use a different class because there are many objects that you can only add to a form/formset. So, for example, an installation could have any one of 50+- forms (modules) with customizable toolbars installed for their needs and the users had control over where and when a form was available to the interface. But I wanted to have each form be a member of the application object--when it was called.
>>
>>Anyhow, I kept running into trouble adding objects to non-formset application objects (of course) so I went ahead an implemented it. It's not the lightest weight object. Starting from scratch I would choose a line class as my application object base class.
>>
>>So, I was thinking that if Michel Creppy really wanted to see his toolbars in a form object rather than using the class designer, one solution would be to use a formset for the application object and then you could add toolbars to the formset.scx. I'm not sure I'm being at all coherent, but I am really trying! *bg*
>>
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform