codemorphis.com Forum Index codemorphis.com
Software development: pure and simple.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

More documented examples

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    codemorphis.com Forum Index -> General Forum
View previous topic :: View next topic  
Author Message
gplasky



Joined: 26 Feb 2004
Posts: 5

PostPosted: Mon Mar 29, 2004 11:48 am    Post subject: More documented examples Reply with quote

I'm wondering if there may more more documentation available? Particularly documentation on some of the included vcp's. I was looking at like the file browser example and I see some things I'm not sure how or why it was done. For instance there is a Windows Form called Window 1 that is not connected to anything. Yet in the nested levels it looks like a reference to the same window form yet it shows up there with a white dotted line around the object. Just not sure how that was done. Any more documentation on any of the included stuff could be very helpful. I'm still trying to get something going here but just stumbling a bit.

Gerry
Back to top
View user's profile Send private message
CodeMorphis



Joined: 02 Dec 2003
Posts: 252

PostPosted: Mon Mar 29, 2004 8:32 pm    Post subject: Reply with quote

Hi Gerry.

There are indeed forth-coming documentation examples for various programming topics and techniques in Synopsis. Recently, resources have been directed towards a lot of new development for the upcoming version.

But you are of course free to ask such questions at any time and we will try to help.

The dotted line around the windows form that you saw in the folder browser example is a visual cue that the component is a reference. For explanation of the component references, please refer to the "Component Referencing" and "Nesting" topics in the Synopsis help documentation. You will find these topics in the "Getting Started\Synopsis Components" chapter of the help. A supplemental explanation follows:

Let's suppose that we have the following simple program:



This program just causes the windows form to be displayed. The connection of interest is the green line. This green connection is called an object component connection (please refer to the Synopsis help documentation for further discussions about object components).

Basically, an object component is a component that offers services or functionalities but also "remembers" information. For example, a windows form component remembers the position of the windows form on the screen, it retains a list of user interface components (such as the button in the example above), etc. At any time during the run of the program, you can interface with the windows form component to retrieve or set information or to make it do something, like display itself, refresh itself, close the window, etc.

To select from the list of component services offered, you use a service call component (obtained from the System tab of the component tray). Click on the green port of the service call component with the left mouse button and then click on the green port of the windows form component. A list dialog appears and you can then select the desired service. The currently selected service appears in the display area of the service call component. In our example above, we see that the "Show form" service is selected.

Now, component referencing is related to component nesting. Let's continue our example to see how.

Let's select the service call component by clicking on it with the left mouse button. The result is:



Now, from the Synopsis menu, click on Component | Nest Component(s).

The result of this action is shown below:



What has happened here? We have nested the service call component. This means that the service call component is now contained by the new nesting component, "Nesting 1". Where did the service call component go? To see it, double click on the nesting component. This takes us "inside" the nesting component. The result of this action is shown below:



Note that we have "descended" into the nesting component. Note the black outlined rectangle surrounding the components. This rectangle represents the nesting component which now contains the nested components. The nesting component has an input process port (red port). The port has a connection on the external side, which is the interface that is used by components connecting to the nesting component. The port also has an internal interface to which you can connect nested components.

To exit the nesting component, double click on an area inside the black rectangle that is not occupied by a component. We could also acheieve the same result by clicking on the "Dec" in the nesting control of the Synopsis toolbar. Notice that as you enter or exit the nesting component the nesting level value in the Synopsis toolbar changes. When we are inside the nesting component, the value increases to 1 and when we exit the nesting component the value decreases to 0. This is because the level at which the Start component resides is the highest level, or level 0. As we descend into nesting components, the nesting level increases.

Note that at level 0, the Start component's output process port (red) is connected to the input process port of the nesting component. During program execution, control is passed from the Start component to the nesting component via this connection. As we saw inside the nesting component (level 1), control will then be passed to the nested service call component, which calls the "Show form" service of the windows form component.

Now, here is where we get to the idea of component referencing.

When we invoked the nesting operation we had only selected the service component. But the service call component acts upon the windows form component. So the nesting command created a component reference to the windows form. This is indicated with the dashed border around the nested windows form reference. This means that the component is actually the windows form component residing at nesting level 0. If you exit the nesting component you will see that the original windows form component does not have a dashed border.

If you make a change to the windows form component then the change will apply to all references of the windows form. To see this, go to nesting level 0 and double click on the windows form. Delete the button of the form and then close the form. Now enter the nesting component and double click on the reference to the windows form. Note that the button is gone. This is because the component reference is actually the original windows form. The only function of the component reference is to allow us to access the original windows form from whatever part of the program that we wish.

Now try this. Return to level 0 and click on the windows form component. Press Ctrl-C to copy the windows form component. Double click on the nesting component and then press Ctrl-V to paste the windows form component inside the nesting component. Note that a reference has now been copied inside the nesting component. We can now connect this reference to a service call component to access the windows form.

Hope that this helps to understand the concept of nesting and component references. If you require further information, please do not hesitate to ask more questions.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
gplasky



Joined: 26 Feb 2004
Posts: 5

PostPosted: Tue Mar 30, 2004 8:05 pm    Post subject: Reply with quote

Thanks for the detailed explanation. I will dig deeper into the help file. But your explanation is excellent and clears up quite a bit for me. Thank you.


Gerry
Back to top
View user's profile Send private message
CodeMorphis



Joined: 02 Dec 2003
Posts: 252

PostPosted: Wed Mar 31, 2004 2:01 am    Post subject: Reply with quote

You are very welcome.

If you have any other questions, please do not hesitate to ask.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    codemorphis.com Forum Index -> General Forum All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group