bb.donnay-software.com

Donnay Software Web Forums
It is currently Wed Dec 11, 2019 2:18 am

All times are UTC - 7 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Redawing of a commadnBar
PostPosted: Mon Jan 17, 2011 11:29 am 
Offline

Joined: Wed Jan 27, 2010 10:23 pm
Posts: 33
Hi..

it#s a little frustrating to try to look behind the architecture of XCodeJock--

I need to change captions and group titles of a commandbar object on-the-fly..

CJAddControl does not allow the use of a codeblock as a caption, so I tried
to use variables instead and try to redraw the complete commandbar with
oCommanBar:RedrawBar()

This fails and error log says. Unknown method for this object..
Documentation of CodeJock says that there IS a method called Redrawbar..

Any help?

- Michael


Top
 Profile  
 
PostPosted: Mon Jan 17, 2011 12:08 pm 
Offline
User avatar

Joined: Thu Jan 28, 2010 12:59 am
Posts: 749
Location: Berlin, Germany
Check your mail. ;)

_________________
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."


Top
 Profile  
 
PostPosted: Mon Jan 17, 2011 4:28 pm 
Offline
Site Admin
User avatar

Joined: Wed Jan 27, 2010 6:58 pm
Posts: 4013
Location: Boise, Idaho USA
Tom -

Michael sent me a private email about this, but I didn't have a quick answer because I have spent so little time with Commandbars.

Thank you for doing my support for me again.

I'm down on the US/Mexico border this week, getting a lot more dental work done, so my wits are not with me at the moment. I had a root canal today and another on Wednesday. I'm glad I brought wine with me.

The temp here today is 85 degrees F.

Roger

_________________
The eXpress train is coming - and it has more cars.


Top
 Profile  
 
PostPosted: Tue Jan 18, 2011 12:55 am 
Offline

Joined: Wed Jan 27, 2010 10:23 pm
Posts: 33
Roger -

I wonder why the Method RedrawBar() crashes.. this should be a method
of the commandbar object like the documentation says..

- Michael


Top
 Profile  
 
PostPosted: Tue Jan 18, 2011 4:56 am 
Offline
User avatar

Joined: Thu Jan 28, 2010 12:59 am
Posts: 749
Location: Berlin, Germany
Here's some code based on the sample from Chris which works. Calling a menu entry sets the caption of the SLE. Remember to change the version # of CJ.

Code:
///////////////////////////////////////////////////////////////////////////////
//
//  Ribbonbar with Xbase++ and eXPress++
//  Creation date: 12/12/2008
//  Chris Andries - ABO service bvba - Belgium
//
///////////////////////////////////////////////////////////////////////////////

#include "Gra.ch"
#include "Xbp.ch"
#include "Appevent.ch"
#include "Font.ch"
#INCLUDE "dcdialog.CH"
#INCLUDE "commandbars.CH"

//define CommandbarCLSID '{D59F55F6-5C22-4C23-80D6-FED9AD149F2C}'
#define CommandbarCLSID 'Codejock.CommandBars.13.4.0'


PROC appsys ; RETURN

function Main()

LOCAL Getlist[0], Getoptions,  oCommandBar, oStatic, oRibbon, oSearchGroup

@ -1,0 DCACTIVEXCONTROL oCommandbar SIZE 50, 10  ;
      CLSID CommandbarCLSID ;
      EVAL {|o| o:visualtheme := 2, ;
                o:add("commandbar",xtpBarTop) ,;
                ;// o:caption := 'Ribbon Bar Sample', ;
                o:execute := {|o|_execute(o,oStatic,oRibbon,oSearchGroup)}, ;
                _StartRibbon(o,@oRibbon,@oSearchGroup)};
      RESIZE DCGUI_RESIZE_REPOSONLY_Y

@ 9,0 DCSAY '' OBJECT oStatic COLOR GRA_CLR_RED, GRA_CLR_WHITE ;
      SIZE 50, 10 FONT '24.Arial Bold' SAYWORDBREAK ;
      RESIZE DCGUI_RESIZE_RESIZEONLY

DCGETOPTIONS RESIZE

DCREAD GUI TITLE 'CodeJock Command Bar' OPTIONS GetOptions FIT

RETURN nil

* -----------

STATIC FUNCTION _StartRibbon(o,oRibbonBar,oSearchGroup)

Local oControl, oPopUp, oTab1, oTab2, oControlFile

oRibbonBar := o:AddRibbonBar("Ribbonbar1")
oRibbonBar:enableDocking(xtpFlagStretched)

oControlFile := oRibbonBar:AddSystemButton()
oControlFile:IconId := 0
oControlFile:Caption := "&File"
oControlFile:CommandBar:Controls:Add( xtpControlButton, 10, "&New" )
oControlFile:CommandBar:Controls:Add( xtpControlButton, 11, "&Open..." )
oControlFile:CommandBar:Controls:Add( xtpControlButton, 12, "&Save" )
oControlFile:CommandBar:Controls:Add( xtpControlButton, 13, "Save &As..." )

oControl := oRibbonBar:Controls:Add(xtpControlPopup, -1, "&Popup ONE", 1)

oPopUp := oControl:CommandBar:Controls
oPopUp:Add(xtpControlButton, 1, "&Nieuw")
oPopUp:Add(xtpControlButton, 2, "&Edit")

oControl := oPopUP:Add(xtpControlButton, 3, "&Save")
oControl:BeginGroup := .T.

oTab1 := oRibbonBar:InsertTab(0, "&Write")
oTab2 := oRibbonBar:InsertTab(0, "&Read")
oGroup := oTab1:Groups:AddGroup("Group",50)
oSearchGroup := oGroup:Add(xtpControlEdit, 51, "Search:")
oSearchGroup:EditHint := "Enter here..."
oSearchGroup:Width := 100
oSearchGroup:TextLimit := 20
oSearchGroup:Text := Space(20)
oSearchGroup:Enabled := .T.
oSearchGroup:SetProperty("ReadOnly",.F.)

return nil

* ------------

STATIC FUNCTION _execute( oPopup, oStatic, oRibbon,oSearchGroup )

LOCAL cMessage

IF oPopup:id == 1
  cMessage := 'Nieuw from Popup'
ELSEIF oPopup:id == 2
  cMessage := 'Edit from Popup'
ELSEIF oPopup:id == 3
  cMessage := 'Save from Popup'
ELSEIF oPopup:id == 10
  cMessage := 'New from System Menu'
ELSEIF oPopup:id == 11
  cMessage := 'Open from System Menu'
ELSEIF oPopup:id == 12
  cMessage := 'Save from System Menu'
ELSEIF oPopup:id == 13
  cMessage := 'SaveAs from System Menu'
ENDIF

IF !Empty(cMessage) .AND. Valtype(oStatic) == 'O'
  oStatic:setCaption('You selected: ' + cMessage)
  oSearchGroup:Caption := cMessage
  oRibbon:RedrawBar()
  oRibbon:RecalcLayout()
ENDIF

RETURN nil

_________________
Best regards,
Tom

"Did I offend you?"
"No."
"Okay, give me a second chance."


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 7 hours


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB® Forum Software © phpBB Group