PDA

View Full Version : Page.CreateObject() limitation?!


bule
08-23-2008, 09:48 AM
I need to use Page.CreateObject() to create shape objects
dynamically to show schedules for undermined number of halls.
Shape object height will depend on the number of halls.

Page.CreateObject() action seem not to be able to do so.
Is there any particular reason for this limitation?

For example, something like this:
Page.CreateObject(OBJECT_PLUGIN, "NewObject", {PluginName="Shape"});

Dermot
08-23-2008, 11:21 AM
It would be nice to be able to create plugins as well. I use a Paragrapgh object when I need to create boxes or bars at runtime. The advantage is that it is easy to add text and make the boxes clickable. I usually have a hidden one that I copy the properties from.

bule
08-23-2008, 11:57 AM
Well I resorted to that as well.

reteset
08-23-2008, 01:53 PM
You Can Create Shapes Dynamically With WinApi Action Plugin
But You Will Need A Timer For Keep Shapes On Page Surface

holtgrewe
08-23-2008, 09:33 PM
This is definately not a solution to the problem, but something I've done in the past with children's color book project.

Similiar to what Dermot mentioned, I've had multiple invisible plugin 'shapes', resized, positioned and made visible when needed. It didn't seem to affect the size of the project significantly. But in lieu of an undetermined number, you'd need to set some maximum. I don't know how much dead-weight that could add to a project.

Dynamic shape creation would be a welcome feature...

bule
08-24-2008, 03:28 AM
I think that the problem is the custom plugin properties.
If I am correct, plugins save all of their settings in one
line in the xml file that is also known as your project file:

<Object>
<Type>40</Type>
<Name>plBack1</Name>
<VisibleAtDesignTime>1</VisibleAtDesignTime>
<VisibleAtRunTime>1</VisibleAtRunTime>
<Locked>0</Locked>
<Enabled>1</Enabled>
<ToolTip/>
<Cursor>0</Cursor>
<Group>0</Group>
<MaintainAspectRatio>0</MaintainAspectRatio>
<Pin>0</Pin>
<TabIndex>-1</TabIndex>
<AutoResize>0</AutoResize>
<Coordinates>
<Top>84</Top>
<Bottom>253</Bottom>
<Left>448</Left>
<Right>605</Right>
</Coordinates>
<Ratios>
<WidthRatio>-1.000000</WidthRatio>
<HeightRatio>-1.000000</HeightRatio>
</Ratios>
<Event>
<Name>On Click</Name>
<Args/>
<Script/>
<TreeStates>
<TreeState>0</TreeState>
<TreeState>0</TreeState>
<TreeState>0</TreeState>
</TreeStates>
<BookMarks count="0">
</BookMarks>
</Event>
<Event>
<Name>On Enter</Name>
<Args/>
<Script/>
<TreeStates>
<TreeState>0</TreeState>
<TreeState>0</TreeState>
<TreeState>0</TreeState>
</TreeStates>
<BookMarks count="0">
</BookMarks>
</Event>
<Event>
<Name>On Leave</Name>
<Args/>
<Script/>
<TreeStates>
<TreeState>0</TreeState>
<TreeState>0</TreeState>
<TreeState>0</TreeState>
</TreeStates>
<BookMarks count="0">
</BookMarks>
</Event>
<Actions/>
<PLUGIN>
<DLLFile>Shape\Shape.apo</DLLFile>
<CustomData>1,0,2631720,1,1,16117995,7,7</CustomData>
</PLUGIN>
<MouseOverSndMode>0</MouseOverSndMode>
<MouseOverSound/>
<MouseClickSndMode>0</MouseClickSndMode>
<MouseClickSound/>
</Object>

The structure of this line is unknown to the APMS.