Hello
I am porting my VO business app to XSharp, the app was written some years ago and I am now taking the advantage of using XSharp VO dialect and Visual Studio to start afresh.
I have created a XSharp MDI VO app and started to move code across from VOXPorter, my first problem is attaching a Tooolbar to the ShellWindow, below is the code I am using, the app runs showing the menu with a blank Toolbar ? In my VO app I used SEUIXP not sure if available for XSharp ?
///
/// ShellMenu
///
PARTIAL CLASS ShellMenu INHERIT Menu
CONSTRUCTOR( oOwner )
LOCAL oTB AS Toolbar
SELF:PreInit()
SUPER( ResourceID { "ShellMenu" , _GetInst( ) } )
// more menu code....
oTB := Toolbar{}
oTB:ButtonStyle := TB_ICONONLY
oTB:Flat := TRUE
oTB:EnableBands(FALSE)
oTB:Bitmap := ShellWindowRibbon{}
SELF:Toolbar := oTB
RETURN
/// <summary>
/// ShellWindowRibbon.
/// </summary>
CLASS ShellWindowRibbon INHERIT Bitmap
CONSTRUCTOR(kLoadoption, iWidth, iHeight)
SUPER(ResourceID{"ShellWindowRibbon", _GetInst()},kLoadoption, iWidth, iHeight)
RETURN SELF
END CLASS
/// Resource
ShellWindowRibbon Bitmap ResourcesSHELLWINDOWRIBBON.BMP
Create a toolbar and and attach to a shell window
Create a toolbar and and attach to a shell window
Hi Neale!
I don't see in the code where/if you are adding buttons to the toolbar, are you doing that? If not, please have a look in the original generated code in the Mdi sample for the menus, it looks like
etc.
Regarding SEUIXP, it certainly can be ported to X#, I think I remember someone already did that in the past? If that's true, please step in... Otherwise, please try porting it as a normal library, do you get many errors when trying to compile it in X#?
I don't see in the code where/if you are adding buttons to the toolbar, are you doing that? If not, please have a look in the original generated code in the Mdi sample for the menus, it looks like
Code: Select all
oTB:AppendItem(IDT_CLOSE,IDM_StandardShellMenu_File_Close_ID)
oTB:AddTipText(IDT_CLOSE,IDM_StandardShellMenu_File_Close_ID,"Close File")
oTB:AppendItem(IDT_SEPARATOR)
oTB:AppendItem(IDT_CUT,IDM_StandardShellMenu_Edit_Cut_ID)
oTB:AddTipText(IDT_CUT,IDM_StandardShellMenu_Edit_Cut_ID,"Cut")
Regarding SEUIXP, it certainly can be ported to X#, I think I remember someone already did that in the past? If that's true, please step in... Otherwise, please try porting it as a normal library, do you get many errors when trying to compile it in X#?
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Create a toolbar and and attach to a shell window
Hi Neale, hi Chris,
SEUIXP was ported to Vulcan, and starting from this version I was able to move it also to X#.
Please contact Sven Ebert for the X# upgrade of the library.
Porting that library from the VO version may be a bit to difficult as it makes heavy use of the Windows API.
Wolfgang
SEUIXP was ported to Vulcan, and starting from this version I was able to move it also to X#.
Please contact Sven Ebert for the X# upgrade of the library.
Porting that library from the VO version may be a bit to difficult as it makes heavy use of the Windows API.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Create a toolbar and and attach to a shell window
Hello Wolfgang
Do you have Sven Ebert E mail or new website ? as www.ebertonline.de isn't working ?
Neale
Do you have Sven Ebert E mail or new website ? as www.ebertonline.de isn't working ?
Neale
Create a toolbar and and attach to a shell window
Hi Neale,
please try ingenieurbuero at ebertonline dot de
The website has been deactivated, but the email works.
Wolfgang
please try ingenieurbuero at ebertonline dot de
The website has been deactivated, but the email works.
Wolfgang
Wolfgang Riedmann
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Meran, South Tyrol, Italy
wolfgang@riedmann.it
https://www.riedmann.it - https://docs.xsharp.it
Create a toolbar and and attach to a shell window
Thank you for that.
Have E mailed and waiting for reply.
Neale
Have E mailed and waiting for reply.
Neale
Create a toolbar and and attach to a shell window
AppendItem works fine for the IDT_Close etc., but I cant seem to create a bitmap resource from my custom toolbar bitmap as
in the code below ?
/// <summary>
/// ShellWindowRibbon.
/// </summary>
CLASS ShellWindowRibbon INHERIT Bitmap
CONSTRUCTOR(kLoadoption, iWidth, iHeight)
SUPER(ResourceID{"ShellWindowRibbon", _GetInst()},kLoadoption, iWidth, iHeight)
RETURN SELF
END CLASS
/// Resource
ShellWindowRibbon Bitmap ResourcesSHELLWINDOWRIBBON.BMP
in the code below ?
/// <summary>
/// ShellWindowRibbon.
/// </summary>
CLASS ShellWindowRibbon INHERIT Bitmap
CONSTRUCTOR(kLoadoption, iWidth, iHeight)
SUPER(ResourceID{"ShellWindowRibbon", _GetInst()},kLoadoption, iWidth, iHeight)
RETURN SELF
END CLASS
/// Resource
ShellWindowRibbon Bitmap ResourcesSHELLWINDOWRIBBON.BMP
Create a toolbar and and attach to a shell window
Hi Neale,
Can you please zip and post the solution, so we can have a look?
Can you please zip and post the solution, so we can have a look?
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu
Create a toolbar and and attach to a shell window
Hello Chris
Solution attached.
Solution attached.
- Attachments
-
- Artisan4.rar
- (1.42 MiB) Downloaded 89 times
Create a toolbar and and attach to a shell window
Hi Neale,
Thanks for the file! The first problem is that the compiler thinks that by "Bitmap", you are referring to System.Drawing.Bitmap, a class defined in the system classes. In order to fix this, remove the command "USING System.Drawing" from the beginning of the prg and/or remove the entry "System.Drawing" from the project References.
Next problem is that the file ShellWindowRibbon.rc is saved in unicode format, and unfortunately the windows resource compiler does not like that. To fix this, open the file, select File->Save As, then click on the arrow next to the Save button and select "Save with encoding". Now select from the list "Western European 1252" or any other non-unicode codepage you prefer and it will be fine. Or you can change the text format with an external editor if you prefer.
Now the bitmap will be loaded from the resource. In order to assign one of the bitmaps to the toolbar buttons, you will need to use an appropriate index for oTB:AppendItem(), for example
oTB:AppendItem(1, IDM_ShellMenu_Help_About_ID)
Hope this helps!
Thanks for the file! The first problem is that the compiler thinks that by "Bitmap", you are referring to System.Drawing.Bitmap, a class defined in the system classes. In order to fix this, remove the command "USING System.Drawing" from the beginning of the prg and/or remove the entry "System.Drawing" from the project References.
Next problem is that the file ShellWindowRibbon.rc is saved in unicode format, and unfortunately the windows resource compiler does not like that. To fix this, open the file, select File->Save As, then click on the arrow next to the Save button and select "Save with encoding". Now select from the list "Western European 1252" or any other non-unicode codepage you prefer and it will be fine. Or you can change the text format with an external editor if you prefer.
Now the bitmap will be loaded from the resource. In order to assign one of the bitmaps to the toolbar buttons, you will need to use an appropriate index for oTB:AppendItem(), for example
oTB:AppendItem(1, IDM_ShellMenu_Help_About_ID)
Hope this helps!
Chris Pyrgas
XSharp Development Team
chris(at)xsharp.eu
XSharp Development Team
chris(at)xsharp.eu