Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Philosophical question
Message
From
01/05/1998 15:32:46
 
 
To
30/04/1998 13:18:05
Ryan Hirschey
Federal Reserve Bank of New York
New York City, New York, United States
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00095802
Message ID:
00096384
Views:
26
>Ryan -
Thanks, it was my brain that was stuck. I didn't realize I could change the container until after you pointed out I can edit it. When I tried it again, everything worked ok as far as the sizing, realignment, etc. Nonetheless, after your comments and David's, I realize I'd broken some class rules (referring to other object outside the container). I want to avoid that, but still need to be able to disable/enable some navigation buttons that are part of another class when someone is doing query stuff. You mentioned you had created a query by form object. Is that an issue for you, and if so, how do you handle it?

I'm wondering if this a situation where I should make all the buttons part of the same class, or if I can handle the need to refer to other objects with methods. If the later, is it better to create custom methods for each button, the container, or the form? This is the kind of thing which still really confuses me.

Thanks again for your help,

Sylvia

Sylvia,
>I'm not sure why you are 'stuck' with the size for your navigation buttons. I had no problem changing the positioning and size of the container and all the contained buttons both in the class and the form designer. I wonder if you have code that is setting some display properties at run-time.
>
>For the container as well as the contained controls, you should be able to change top, left, width, and height properties to get the desired visual effect. If you want to change the positioning of the contained controls (commandbuttons, etc.) you must first right-click on the container. Select the edit option from the short-cut menu. The container will be highlighted at this point. From here on you can select any of the objects inside the container and move, resize, etc. If this does not work, then you might have created your class based on the control baseclass. This baseclass prevents you from accessing and modifying the contained controls.
>
>>>Ryan -
>>Can you tell me which properties you modified in the container to do that (i.e. position, orientation, size)? When I created a class out of some navigation buttons I found I was stuck with the size, and any attempts on my part to change that were unsuccessful, i.e. the buttons got messed up. So I thought that wasn't a very flexible approach. By the way, it is for a Query that I want to do this (not that it matters).
>>Sylvia
>>
>>Sylvia, you wouldn't lose any flexibility in using David's recommendation. If you choose to have buttons aligned vertically or horizontally, this can be done, either through subclassing or simply modifying the properties of the container and the contained controls on a form. I just tested this with some buttons emmbedded in a container that I use as a query by form object. You can not only change the size of the container on a form, but you can also change the position and orientation of the contained controls, all without having to create a subclass. Of course, if you feel you will use both alignments frequently, you may want to subclass one from the other, where the only difference is the visual display properties.
>>>
>>>HTH,
>>>Ryan
>>>
>>>>>David -
>>>>
>>>>Thanks, I was considering doing that, and that probably is the way to go here. But doing that means I lose some flexibility in button placement and size (for example, the buttons in question for this app are vertically aligned). So then I have to create one set vertical and one set horizontal! That's when I started thinking about this whole issue and thinking "Geez, how far do I want to go with the classes?"
>>>>
>>>>
>>>>Sylvia,
>>>>>
>>>>>One way of doing this if you've got a group of controls that need to function together is to put them in a container. They can talk to each other using this.parent.AnotherControl. The container becomes the place to put common methods so the controls can just call a this.parent.Method() to get stuff done. So this whole thing becomes a functional component that can just be dropped onto something else a form, page or other container.
>>>>>
>>>>>Also the user of this component shouldn't know anything about what's inside the container, they only deal with the public interface of the container, and the container is responsible for talking to the controls inside it.
>>>>>
>>>>>>I found some command buttons I thought were useful and saved them in one of my class libraries. Now I find some of the custom properties make assumptions about where these and other buttons are on the form (e.g. refer to Thisform.cmdenterquery) which is, of course, not where I've put the command buttons in this situation (I have them on a page). My philosophical question is: should I just go ahead and put in my own code to replace the default code (which seems to defeat the purpose of less coding, or do I say "Hmmm, I should make another class of buttons for situations where I have the buttons in the page rather than on the form itself."
>>>>>>
>>>>>>This seems to be like an issue of standards (e.g. keep button on form) vs. adaptability (I need them on the page this time). How do you decide "Yep, this is a class", or "Nope, this should be a custom or modification of existing method."?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform