|
Hi mudnug,
Now I moved to http://windowsribbon.codeplex.com/
Until now it works fine and I can substituite the DotSpatial RibbonControl.
I downloaded the mapwindow 6 project source and looked at the code but I cannot find where and how you configure the DevExpress Ribbon?
Where is the code for each button? I am VB developer but I can read the C# code ....
The Windows Ribbon for WinForms project is a wrapper, open source like DotSpatial :-) but has one limitation, Windows XP is not supported.
Ate the Windows Ribbon for WinForms I can create a RibbonMarkup.xml file for all commands like this.
<?xml version='1.0' encoding='utf-8'?>
<Application xmlns='http://schemas.microsoft.com/windows/2009/Ribbon'>
<Application.Commands>
<Command Name="cmdApplicationMenu" Id="1000" />
.......
<Command Name="cmdButtonPrint"
Id="1004"
LabelTitle="Print"
LabelDescription="Print Description"
TooltipTitle="Print"
TooltipDescription="Print the current map project.">
<Command.LargeImages>
<Image>Res/Print32.bmp</Image>
</Command.LargeImages>
<Command.SmallImages>
<Image>Res/Print16.bmp</Image>
</Command.SmallImages>
</Command>
Then Enum the commands
Public Enum RibbonMarkupCommands As UInteger
cmdApplicationMenu = 1000
cmdButtonNew = 1001
cmdButtonOpen = 1002
cmdButtonSave = 1003
cmdButtonPrint = 1004
cmdButtonExit = 1005
End Enum
Declare the commands
Private _applicationMenu As RibbonApplicationMenu
Private _buttonNew As RibbonButton
Private _buttonOpen As RibbonButton
Private _buttonSave As RibbonButton
Private _buttonExit As RibbonButton
Private _buttonPrint As RibbonButton
Create the buttons
_applicationMenu = New RibbonApplicationMenu(_ribbon, CUInt(RibbonMarkupCommands.cmdApplicationMenu))
_buttonNew = New RibbonButton(_ribbon, CUInt(RibbonMarkupCommands.cmdButtonNew))
_buttonOpen = New RibbonButton(_ribbon, CUInt(RibbonMarkupCommands.cmdButtonOpen))
_buttonSave = New RibbonButton(_ribbon, CUInt(RibbonMarkupCommands.cmdButtonSave))
_buttonPrint = New RibbonButton(_ribbon, CUInt(RibbonMarkupCommands.cmdButtonPrint))
_buttonExit = New RibbonButton(_ribbon, CUInt(RibbonMarkupCommands.cmdButtonExit))
Add Handler
AddHandler _buttonNew.ExecuteEvent, AddressOf _buttonNew_ExecuteEvent
AddHandler _buttonOpen.ExecuteEvent, AddressOf _buttonOpen_ExecuteEvent
AddHandler _buttonPrint.ExecuteEvent, AddressOf _buttonPrint_ExecuteEvent
And use it
Private Sub _buttonPrint_ExecuteEvent(ByVal sender As Object, ByVal e As ExecuteEventArgs)
Dim frm As New DotSpatial.Controls.LayoutForm
frm.MapControl = Map1
frm.Show()
End Sub
|