Codejock Forums Homepage
Forum Home Forum Home > Codejock Products > ActiveX COM > Command Bars
  New Posts New Posts RSS Feed - Designer question
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Designer question

 Post Reply Post Reply
Author
Message
JSram View Drop Down
Groupie
Groupie


Joined: 22 October 2004
Status: Offline
Points: 42
Post Options Post Options   Thanks (0) Thanks(0)   Quote JSram Quote  Post ReplyReply Direct Link To This Post Topic: Designer question
    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.
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
ianp View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 19 December 2003
Location: United Kingdom
Status: Offline
Points: 119
Post Options Post Options   Thanks (0) Thanks(0)   Quote ianp Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 24 February 2005 at 4:28am
Do you have SerializeImages enabled?
Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
ianp View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 19 December 2003
Location: United Kingdom
Status: Offline
Points: 119
Post Options Post Options   Thanks (0) Thanks(0)   Quote ianp Quote  Post ReplyReply Direct Link To This Post 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...

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 24 February 2005 at 8:09am
Do you have SerializeDesignerControls enabled?
Back to Top
ianp View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 19 December 2003
Location: United Kingdom
Status: Offline
Points: 119
Post Options Post Options   Thanks (0) Thanks(0)   Quote ianp Quote  Post ReplyReply Direct Link To This Post 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)



Edited by ianp
Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post Posted: 24 February 2005 at 10:08am
You must save the XML file with SerializeDesignerControls = True.  Then try to open it.
Back to Top
ianp View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 19 December 2003
Location: United Kingdom
Status: Offline
Points: 119
Post Options Post Options   Thanks (0) Thanks(0)   Quote ianp Quote  Post ReplyReply Direct Link To This Post 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?

Back to Top
SuperMario View Drop Down
Admin Group
Admin Group
Avatar

Joined: 14 February 2004
Status: Offline
Points: 18057
Post Options Post Options   Thanks (0) Thanks(0)   Quote SuperMario Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
ianp View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 19 December 2003
Location: United Kingdom
Status: Offline
Points: 119
Post Options Post Options   Thanks (0) Thanks(0)   Quote ianp Quote  Post ReplyReply Direct Link To This Post 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

Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
ianp View Drop Down
Moderator Group
Moderator Group
Avatar

Joined: 19 December 2003
Location: United Kingdom
Status: Offline
Points: 119
Post Options Post Options   Thanks (0) Thanks(0)   Quote ianp Quote  Post ReplyReply Direct Link To This Post Posted: 24 February 2005 at 3:19pm
perfect, thanks. Should I reset the option after loading the XML file?
Back to Top
Oleg View Drop Down
Admin Group
Admin Group


Joined: 21 May 2003
Location: United States
Status: Offline
Points: 11234
Post Options Post Options   Thanks (0) Thanks(0)   Quote Oleg Quote  Post ReplyReply Direct Link To This Post Posted: 25 February 2005 at 1:17am

no.

Oleg, Support Team
CODEJOCK SOFTWARE SOLUTIONS
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.156 seconds.