 |
|
 |
a nice tutorial on how to use this control is here:
http://www.universalthread.com/ViewPageArticle.aspx?ID=176[^]
coming from Delphi too, I like this control a lot, have used it at LvS (Learning Via Subtitiling) opensource VB.net app:
http://LvS.codeplex.com[^]
Computer & Informatics Engineer
Microsoft MVP J# 2004-2010
Borland "Spirit of Delphi" 2001
QuickTime, QTVR, Delphi VCL,
ActiveX, COM, .NET, Robotics
http://www.zoomicon.com
http://zoomicon.wordpress.com
|
|
|
|
 |
|
 |
I create button at runtime and want to assign action to it, but I don't know how to do that in runtime
any idea for that
|
|
|
|
 |
|
|
 |
|
|
 |
|
 |
Serge,
Can you throw more light on
"It should be possible to hook the event loop for processing shortcuts",
would be highly appreciated.
I need my application to just have one actionlist.action,
and execute method on this actionlist.action
gets executed by button_click, menu_click or short cut key press
without specifying shortcut in menu's properties and only
specifying shortcut in actionlist.action's property.
Thanks,
Jay
|
|
|
|
 |
|
 |
This one on MSDN doesn't have any designers, but it's easy to wire things up in code. You may want to look at this:
http://msdn.microsoft.com/library/default.asp?url=/msdnmag/issues/02/10/commandmanagement/TOC.ASP
It doesn't support Images, Text, and hints, but the code is simpler and easier to modify to meet any special needs you may have.
By the way, one of the code "fixes" submitted here in another message can cause problems in some situations - I think it's the one that handles nulls in the collection. Be careful about this.
|
|
|
|
 |
|
 |
Hi,
It seems that unless you have a control associated to a given action (for instance, you'd like to have the action performed only using the shortcut), then the shortcut doesnt work. More than that - if for instance you associate your action with a menu item, then you set to null the menu of the form, the shortcut doesnt work.
I see it also a bit not very intuitive (to me ) having to select the added action from the combobox of the properties toolbar in order to add events - maybe it would be possible to do it also in the same dialog (where adding the actions to the list)? Eventually like a "Properties" button that automatically selects the action in that toolbar combobox?
I'm new to .Net so sorry if my critics dont make sense.
Apart from that, I havent seen anything else wrong.
Don
|
|
|
|
 |
|
 |
Coming from a trolltech qt c++ background, I was amazed actions were not in windows.Forms. Well done it is useful
|
|
|
|
 |
|
 |
Thanks for your usefull component, mainly for those accustomed to work with Delphi.
Didier Vaudène
Université Pierre et Marie Curie
Paris
|
|
|
|
 |
|
 |
At first, it's a good thing.
But I couldn't find any method firing Execute event to run it from code. For example, handler of Save event would call to SaveAs if the file was not saved previously.
|
|
|
|
 |
|
 |
...It almost works, CloneMenu seems to copy all of the actual menu item properties across so the text appears correct and the event handler correctly calls the action. However the extended "Action on ..." property is not copied and so the Action with the menu logic knows nothing about the new cloned menu item that references it. Setting Checked or Enabled (or presumably even changing the Text) on the Action does not affect the cloned menuItem
You can't override CloneMenu as it is non-virtual and even if you could I'm not sure there is a way to discover and copy any extended properties on the current object.
|
|
|
|
 |
|
 |
Hi
How I can associate the event proc in VB.NET to Action ?, only using AddHandler ?
Thanks
|
|
|
|
 |
|
 |
In runtime,change the toolbutton's action
:
foreach(Action CurrAction in MainActionList.Actions)
MainActionList.SetAction(toolBar.Buttons[i],CurrAction);
if changed more than one ,then Click the button will exec action more than once.
Chy
|
|
|
|
 |
|
 |
Hi,
Any attempt to set the Action property of a control to (none) causes the IDE to crash. It seems that the following modifications to ActionList.setAction fixes the problem:
[ExtenderProvidedProperty()]
public void SetAction(Component comp, Action value)
{
Debug.Assert(comp != null /*&& value != null*/);
Action res = (Action)_components[comp];
if (res != null)
{
if (value == res)
{
return;
}
res.SetComponent(comp, false);
_components.Remove(comp);
}
if ((value != null) && (value != Actions.Null))
{
value._owner = this;
value.SetComponent(comp, true);
_components.Add(comp, value);
}
else
_components.Remove(comp);
}
This code may certainly be optimized...
--Patrick Philippot
Microsoft MVP [.Net]
Consulting Services
www.mainsoft.fr
|
|
|
|
 |
|
 |
>This code may certainly be optimized...
This way, for example:
public void SetAction(Component comp, Action value)
{
Debug.Assert(comp != null);
if (value != null)
{
Action res = (Action)_components[comp];
if (res != null)
{
if (value == res)
{
return;
}
res.SetComponent(comp, false);
_components.Remove(comp);
}
if (value != Actions.Null)
{
value._owner = this;
value.SetComponent(comp, true);
_components.Add(comp, value);
}
}
else
_components.Remove(comp);
}
--Patrick Philippot
Microsoft MVP [.Net]
Consulting Services
www.mainsoft.fr
|
|
|
|
 |
|
 |
First i think it is great component !
Now to my problem
I have problem with seting shortcut,
i created button, and action for it, everything works fine, but only shortcut key wont work. I set it to F5.
|
|
|
|
 |
|
 |
The action shortcut is set for every associated item which has a "Shortcut" property. Menu items have a "Shorcut" property, buttons have no such properties. So it's no possible to assign them a shortcut...
It should be possible to hook the event loop for processing shortcuts but I don't have time for that at the moment, sorry...
Serge
|
|
|
|
 |
|
 |
This is nicely done. I've missed the Delphi actionlist.
|
|
|
|
 |
|
 |
I'll look into your code as soon as I have more time....
|
|
|
|
 |
|
 |
Hello,
Those interested in using ActionList with VSNetToolbar by Carlos H. Perez (http://www.codeproject.com/cs/miscctrl/VSNetToolBar.asp) please check out the note about how to integrate the two components:
http://www.codeproject.com/cs/miscctrl/VSNetToolBar.asp#xx164342xx
Thanks,
Alexis
|
|
|
|
 |
|
 |
Alexis,
>Those interested in using ActionList with
>VSNetToolbar by Carlos H. Perez
>(http://www.codeproject.com/cs/miscctrl/VSNetToolBar.asp)
>please check out the note about how to integrate
>the two components:
>http://www.codeproject.com/cs/miscctrl/VSNetToolBar.asp#xx164342xx
I can't find this note. Was it removed?
Thanks.
--Patrick Philippot
Microsoft MVP [.Net]
Consulting Services
www.mainsoft.fr
|
|
|
|
 |
|
 |
Yes, it would seem that my comment was removed.
Note that this comment was posted more than a year ago and i see that the article (http://www.codeproject.com/cs/miscctrl/VSNetToolBar.asp) was update a few times since them. It is possible that my advice is out of date anyway
Unfortunately I wasn't able to find that ActionList/VSNetToolBar sample in my archives. So all i can say now is that it was fairly easy to bind VSNetToolBar commands to actions in ActionList.
Alexis Smirnov
weblog: http://radio.weblogs.com/0112946/
|
|
|
|
 |
|
 |
Finally something interesting on .Net not just how
to use such and such wizard. Cool job, will look into the
code right now.
Keep it up! (others please follow the example)
|
|
|
|
 |
|
 |
this was one of the first things I would need when I start really using C#/.NET (rather than just playing with it).
Even under MFC I've generally implemented my own such systems, much better than the command-routing.
I'll look into your code as soon as I have more time....
Regards,
Ray
|
|
|
|
 |