Welcome, Guest
Username: Password: Remember me
Visual Objects

Please use this forum to post questions about Visual Objects and Vulcan.NET
  • Page:
  • 1

TOPIC:

Create a toolbar and and attach to a shell window 23 Jan 2021 14:45 #17271

  • Neale
  • Neale's Avatar
  • Topic Author


  • Posts: 23
  • 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 Resources\\SHELLWINDOWRIBBON.BMP

    Please Log in or Create an account to join the conversation.

    Create a toolbar and and attach to a shell window 23 Jan 2021 16:24 #17274

    • Chris
    • Chris's Avatar


  • Posts: 3738
  • 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

    	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")

    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#?
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Last edit: by Chris.

    Create a toolbar and and attach to a shell window 23 Jan 2021 16:51 #17276

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3244
  • 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
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    Last edit: by wriedmann.

    Create a toolbar and and attach to a shell window 23 Jan 2021 18:30 #17277

    • Neale
    • Neale's Avatar
    • Topic Author


  • Posts: 23
  • Hello Wolfgang
    Do you have Sven Ebert E mail or new website ? as www.ebertonline.de isn't working ?

    Neale

    Please Log in or Create an account to join the conversation.

    Create a toolbar and and attach to a shell window 23 Jan 2021 18:35 #17278

    • wriedmann
    • wriedmann's Avatar


  • Posts: 3244
  • Hi Neale,
    please try ingenieurbuero at ebertonline dot de
    The website has been deactivated, but the email works.
    Wolfgang
    Wolfgang Riedmann
    Meran, South Tyrol, Italy

    www.riedmann.it - docs.xsharp.it

    Please Log in or Create an account to join the conversation.

    Create a toolbar and and attach to a shell window 25 Jan 2021 19:16 #17289

    • Neale
    • Neale's Avatar
    • Topic Author


  • Posts: 23
  • Thank you for that.
    Have E mailed and waiting for reply.

    Neale

    Please Log in or Create an account to join the conversation.

    Create a toolbar and and attach to a shell window 25 Jan 2021 19:35 #17290

    • Neale
    • Neale's Avatar
    • Topic Author


  • Posts: 23
  • 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 Resources\\SHELLWINDOWRIBBON.BMP

    Please Log in or Create an account to join the conversation.

    Create a toolbar and and attach to a shell window 25 Jan 2021 23:27 #17294

    • Chris
    • Chris's Avatar


  • Posts: 3738
  • Hi Neale,

    Can you please zip and post the solution, so we can have a look?
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Create a toolbar and and attach to a shell window 26 Jan 2021 22:25 #17299

    • Neale
    • Neale's Avatar
    • Topic Author


  • Posts: 23
  • Hello Chris

    Solution attached.
    Attachments:

    Please Log in or Create an account to join the conversation.

    Create a toolbar and and attach to a shell window 27 Jan 2021 01:41 #17307

    • Chris
    • Chris's Avatar


  • Posts: 3738
  • 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!
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Create a toolbar and and attach to a shell window 27 Jan 2021 22:37 #17326

    • Neale
    • Neale's Avatar
    • Topic Author


  • Posts: 23
  • Thanks Chris that worked, but the bitmaps are not showing there full image, I have tried a single bitmap 48x48
    created in VS with the same result ?

    Please Log in or Create an account to join the conversation.

    Create a toolbar and and attach to a shell window 27 Jan 2021 23:37 #17327

    • robert
    • robert's Avatar


  • Posts: 3276
  • Neale,

    The bitmaps in the ribbon are 24 bits.
    Try this:

    oTb:ButtonSize := Dimension{24,24}
    oTb:Bitmap := ShellWindowRibbon{,,24,24}

    oTB:AppendItem(2, IDM_ShellMenu_Help_About_ID, oTB:Bitmap ) // works, but no bitmap
    oTB:AddTipText(IDT_HELP, IDM_ShellMenu_Help_About_ID, "Help About")

    This shows the 2nd image in the bitmap

    Robert
    XSharp Development Team
    The Netherlands

    Please Log in or Create an account to join the conversation.

    Create a toolbar and and attach to a shell window 27 Jan 2021 23:42 #17328

    • Chris
    • Chris's Avatar


  • Posts: 3738
  • HI Neale,

    Yeah, I was seeing this as well, found what's the problem, the bitmap's height is 24 pixels, instead of the default 16. Add this and it works:

    oTB:ButtonSize := Dimension{24,24}
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Create a toolbar and and attach to a shell window 27 Jan 2021 23:44 #17329

    • Chris
    • Chris's Avatar


  • Posts: 3738
  • Oh well, I think we need to make an agreement with Robert, that from now on he only replies on even hours and I only reply on odd hours :)
    XSharp Development Team
    chris(at)xsharp.eu

    Please Log in or Create an account to join the conversation.

    Create a toolbar and and attach to a shell window 27 Jan 2021 23:45 #17330

    • Neale
    • Neale's Avatar
    • Topic Author


  • Posts: 23
  • Thank you, all good.

    Please Log in or Create an account to join the conversation.

    Create a toolbar and and attach to a shell window 29 Jan 2021 17:54 #17342

    • Alf
    • Alf's Avatar


  • Posts: 52
  • Hello to all,
    i sometimes heart about SEUIXP, but never used it till today. Can I get some screenshots or so to see the advantages of this tool? Or would it be better to look for similar functions in dotnet-framework? (and, if so, recommends are welcome). My intention is to improve the look and feel of the good old data window.

    Alf

    Please Log in or Create an account to join the conversation.

    Create a toolbar and and attach to a shell window 30 Jan 2021 06:27 #17343

    • ic2
    • ic2's Avatar


  • Posts: 1573
  • Hello Alf,
    Here's a screenshot. As you see you can add text elements (the left text says this is the main menu) and buttons with a sub-menu. In my program the user can select the old 'VO' menu (with much smaller buttons and the SEUIXPmenu. I think I've seen the old menu once or twice on a customer's Pc.

    No doubt there are multiple .Net solution (I use the standard ribbon in one, see photorganize.eu for example) but this is quite easy to use from within VO.

    Dick
    Attachments:

    Please Log in or Create an account to join the conversation.

    • Page:
    • 1