Print Page | Close Window

Designer question

Printed From: Codejock Forums
Category: Codejock Products
Forum Name: Command Bars
Forum Description: Topics Related to Codejock Command Bars
URL: http://forum.codejock.com/forum_posts.asp?TID=1329
Printed Date: 17 May 2024 at 10:21pm
Software Version: Web Wiz Forums 12.04 - http://www.webwizforums.com


Topic: Designer question
Posted By: JSram
Subject: Designer question
Date Posted: 27 October 2004 at 6:17am
I have a question regarding working with the designer vs. code layout, and thought I better know before getting too deep into it.

When using the designer to layout menu and other toolbars, are there any restrictions to how this can be further manupulated in code? I'm thinking of such things as changing Captions and icons. Like with the SplitButtonPopup, I want the icon of the button part to be one of the items shown in the dropdown, and this may change depending either a user setting or last selected item?

Also can parts of the layout be down in the designer and then more controls or toolbars be added by code, or is it one or the other way?

Thanks.



Replies:
Posted By: SuperMario
Date Posted: 23 February 2005 at 2:31pm
With the new XML feature, you can create a CommandBar entirely in code and then export it as a XML file.  You can then open the XML file up in the Designer Studio.  Youc can even create the CommandBar in Designer Studio, export as XML file, load in project, then add controls via code and then export the new layout as a new XML file.  So as you ca see, you can mix and match as you like.


Posted By: ianp
Date Posted: 24 February 2005 at 1:42am

hi supermario

when i load an xml file, the icons don't seem to appear in the commandbars.icons collection, but they do appear in the collection when an xcb file is used.

Is this correct behaviour



Posted By: Oleg
Date Posted: 24 February 2005 at 4:28am
Do you have SerializeImages enabled?

-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: ianp
Date Posted: 24 February 2005 at 7:04am

yes, the images also appear in the commandbars when loaded from the xml file, but they just don't appear in the icons collection

As a result I can't share the commandbars icons collection with the shortcut bar icons collection...



Posted By: SuperMario
Date Posted: 24 February 2005 at 8:09am
Do you have SerializeDesignerControls enabled?


Posted By: ianp
Date Posted: 24 February 2005 at 10:05am

Yes...Here is the code I use to create the stateoptions

  Set xcbStateOptions = xcbBars.CreateStateOptions
  With xcbStateOptions
    .LoadSilent = False
    .SaveOnlyCustomized = False
    .SaveOriginalControls = True
    .SerializeDesignerControls = True
    .SerializeControls = True
    .SerializeImages = True
    .SerializeLayout = True
    .SerializeOptions = True
  End With

I then load the XML string with this StateOptions. Once I've done this, i then check the icons.count. However the icons object is not initialised (i.e. Is Nothing)



Posted By: SuperMario
Date Posted: 24 February 2005 at 10:08am
You must save the XML file with SerializeDesignerControls = True.  Then try to open it.


Posted By: ianp
Date Posted: 24 February 2005 at 10:21am

The xml file is created by exporting an xcb file from the command bars designer, is it possible to set these options from inside this app?



Posted By: SuperMario
Date Posted: 24 February 2005 at 10:23am
Take a look at the Customizable sample to see how to do this.  You can simply load you xcb file in that sample, make sure SerialiseDesignerControl is selected from the drop-down menu, then export as xml.


Posted By: ianp
Date Posted: 24 February 2005 at 10:57am

I can replicate the same "little problem" in the customise sample:

  1. Open the project, 
  2. Set the "bSerializeDesignerControls = True" in Form_Load event
  3. Run the app
  4. Export to XML
  5. Stop the App
  6. Comment out the line "CommandBars.LoadDesignerBars App.Path & "\visio.xcb""
  7. Call xmlFileLoad at the end of the Form_Load event
  8. Run the app
  9. Select the exported XML file in the open/save dialog
  10. Break the app and check the CommandBars.Icons.Count

However, if you load the xml file AFTER calling LoadDesignerBars the icons object is initialised



Posted By: Oleg
Date Posted: 24 February 2005 at 11:47am

ok. right.

call Options.UseSharedImageList  = False before load xml.

we add this method call automatically in next version.



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS


Posted By: ianp
Date Posted: 24 February 2005 at 3:19pm
perfect, thanks. Should I reset the option after loading the XML file?


Posted By: Oleg
Date Posted: 25 February 2005 at 1:17am

no.



-------------
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.04 - http://www.webwizforums.com
Copyright ©2001-2021 Web Wiz Ltd. - https://www.webwiz.net