MenuItems, I'm trying to figure out how to do this....

  • Thread starter Thread starter M
  • Start date Start date
M

M

Hopefully this will come out right but this is what I'd like

Shapes
=======
Squares
|___by color
|___Red
|___Yellow
|___by size
|__Large
|__Medium
|__Small
Circles
Triangles



Is there a way to have the sub menus attached to Circles and Triangles
without manually adding each one in the code? Yes that would be merging
right? ok now how can I determine who called Large Yellow or Small Red, do
I have to do something like sender->parent->parent->text ?

Thanks
 
MenuItem byColorMenuCloneForCircle = byColorMenu.CloneMenu();
MenuItem byColorMenuCloneForTriangle = byColorMenu.CloneMenu();

CircleMenu.MenuItems.Add(byColorMenuCloneForCircle );
TriangleMenu.MenuItems.Add(byColorMenuCloneForTriangle );
 
Hi "M" (please specify a real name when posting news),

Is there a way to have the sub menus attached to Circles and Triangles
without manually adding each one in the code? Yes that would be merging
right? ok now how can I determine who called Large Yellow or Small Red,
do
I have to do something like sender->parent->parent->text ?
Yes, I believe you have to check the sender-parameter in the event handler,
and trace back as needed.

(Of course you have to wire up the Circles and Triangles MenuItems with the
same sub menus).

Have you thought about redesigning your application, so that there is a more
intuitive way
of selecting your shapes? (e.g. a palette control).

Regards,

Lars Wilhelmsen
Software Engineer
Teleplan A/S, Norway
 
Lars Wilhelmsen said:
Hi "M" (please specify a real name when posting news),


Yes, I believe you have to check the sender-parameter in the event handler,
and trace back as needed.

(Of course you have to wire up the Circles and Triangles MenuItems with the
same sub menus).

Have you thought about redesigning your application, so that there is a more
intuitive way
of selecting your shapes? (e.g. a palette control).

Regards,

Lars Wilhelmsen
Software Engineer
Teleplan A/S, Norway

Thanks for replying.

Its actually not shapes at all but I was just using them as an example. It's
more like a tree control filled with various sets of data and on each set of
data I need to run different statistics. The statistics need to be able to
to be run over the last 5, 10, 15 etc test runs. So it will look like


the tree

Dataset1
|_______statistic1
|_______Last 5 test runs
|_______Last 10 test runs
|_______Last 15 test runs
|_______All test runs in August
|_______All test runs in July
|_______statistic2
|_______Last 5 test runs
|_______Last 10 test runs
|_______Last 15 test runs
|_______All test runs in August
|_______All test runs in July
Dataset2
|_______statistic1
|_______Last 5 test runs
|_______Last 10 test runs
|_______Last 15 test runs
|_______All test runs in August
|_______All test runs in July
Dataset3
|_______statistic1
|_______Last 5 test runs
|_______Last 10 test runs
|_______Last 15 test runs
|_______All test runs in August
|_______All test runs in July


Not exactly like this but something similiar. But you see I need to be able
to determine which Dataset and which statistic triggered the call. It looks
like I might have to do the parent->parent.text thing.

Thanks
 
Thanks

Shakir Hussain said:
MenuItem byColorMenuCloneForCircle = byColorMenu.CloneMenu();
MenuItem byColorMenuCloneForTriangle = byColorMenu.CloneMenu();

CircleMenu.MenuItems.Add(byColorMenuCloneForCircle );
TriangleMenu.MenuItems.Add(byColorMenuCloneForTriangle );
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top