Profile Picture

need a way to position NdockingToolbar

Posted By JSW W. 14 Years Ago
Author
Message
JSW W.
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 127, Visits: 1
Hi Angel
I all working thanks to you.
If I added toolbars.clear() before these code, it messed up everything. Strangely it works without having to clear toolbars first.

Cheers

Angel Chorbadzhiev
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)

Group: Forum Members
Last Active: Last Month
Posts: 139, Visits: 184

Hello JSW W.,

You can set ImageList to each ToolBar and it will working correctly, but when you save a state of the command bars manager it saves only the imageList that is set to the manager and when load the state back it applies only this ImageList to the toolbars.

As I know you cannot set multiple transparent colors in one ImageList.

Regarding the toolbars order it is pretty straightforward:

To set a toolbar in specific row you need to set its RowIndex property to this row. For example if you want to set toolBar1 to be on the second row you need to do the following:

toolbar1.RowIndex = 1;

If you have 2 or more toolbars in the same row their order in that row depends of the order that they were added to the manager's ToolBars collection.

Let say you have toolBar1 and toolBar2 with the same RowIndex and we want to set toolBar2 to be before toolBar1 that you should do the following:

toolbar1.RowIndex = 1;

toolbar2.RowIndex = 1;

manager.ToolBars.Add(toolbar2);

manager.ToolBars.Add(toolbar1);

Regards,

Angel.



JSW W.
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 127, Visits: 1
So is it not possible to use multiple image lists?

My problem is that each image list I set different transparent color. Can I set multiple transparent color in a list?

About the link, I also previously mentioned that the CmdBarsmanger.ToolBars is fix in your editor to sort by alphabet. So I still could not find way to order the toolbars.

In your manager -> toolbars I did not see, how can you reorder the toolbar position.

If this can be solved, then I not have to save and load, all will be working out.

Angel Chorbadzhiev
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)

Group: Forum Members
Last Active: Last Month
Posts: 139, Visits: 184

Hello JSW W.,

To be able to distinguish which command is clicked when NCommandBarsManager.CommandClicked fires you can set and then check the ID property of each command in command bars manager. This approach is demonstrated in Command Bars -> Persistency example from example application provided with installation package.

The only way to determine the position is described in this topic http://community.nevron.com/Forum/shwmessage.aspx?ForumID=2&MessageID=3188.

Regards,

Angel.

 



JSW W.
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 127, Visits: 1
There could be problem for my image List as it set to different transparent colors for each list - also I have a number of images per list so I kind of need them in multiple lists.

Attached all event to nCommandBarsManager.CommandClicked is possible but I have many menus and sub menu so are custom toolbox - there might be some thing i have not oversee.

Are there no alternative to handle the position for each NCB row order and column?

Angel Chorbadzhiev
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)

Group: Forum Members
Last Active: Last Month
Posts: 139, Visits: 184

Hello JSW W.,

When the NCommandBarsState saves and loads the toolbars it keeps only the image list of the NCommandBarsManager and not image list of each toolbar.

To save and load the images correctly, please set the ImageList of the NCommandBarsManager only and set the ImageIndex of each command to the images of this list.

To be able to fire click event of a command after the state was loaded you should be attached to nCommandBarsManager.CommandClicked event instead of attaching to Click event of each command.

Regards,

Angel.



JSW W.
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 127, Visits: 1
Also i attached icon from design page, it only problem when load state from file.

JSW W.
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 127, Visits: 1
on load
m_NCB_State.Manager = m_CmdBarsManager
m_NCB_State.PersistencyFlags = NCommandBarsStateFlags.Toolbars
'Dim userCBSfile As String = m_current_path + "\Res\NCB\user.cbs"
'Dim orgCBSfile As String = m_current_path + "\Res\NCB\org.cbs"
'Dim userFile As New FileInfo(userCBSfile)
'Dim orgFile As New FileInfo(orgCBSfile)
'If userFile.Exists Then
' m_NCB_State.Load(userCBSfile)
'Else
' If orgFile.Exists Then
' m_NCB_State.Load(orgCBSfile)
' End If
'End If

on save
Dim userCBSfile As String = m_current_path + "\Res\NCB\user.cbs"
m_NCB_State.Save(userCBSfile)

I just use these code here.
I could not make tool bar stay in it position, also some NComandBar as show wrong icon ids, it seems to attached to different image list.

Nice website update by the way.

What was missing above, pls ignore the commented lines? - since it is yet working so i commented out.


Angel Chorbadzhiev
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)Supreme Being (142 reputation)

Group: Forum Members
Last Active: Last Month
Posts: 139, Visits: 184

Hello JSW W.,

Can you describe or send us a code snipped how do you set the images of the commands, how do you attach to the event that didn't handle correctly.

Also can you check whether the PersistencyFlags property of the manager is set to All.

Regards, 

Angel.



JSW W.
Posted 14 Years Ago
View Quick Profile
Supreme Being

Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)Supreme Being (127 reputation)

Group: Forum Members
Last Active: 12 Years Ago
Posts: 127, Visits: 1
Hello

I try the similar to your example, save(), load().
It got strange result such as
1) Some icon images incorrect
2) and then the event did not handle correctly - become dead clicks.
3) the rows are correct but order of commands in the row still not correct as saved.

This test is done during form load. The save is done before exit program.



Similar Topics


Reading This Topic