Page 1 of 2

RibbonBar and Win7

Posted: Mon Feb 22, 2010 3:05 am
by Wolfgang Ciriack
Hello Roger,

I have a RibbonBar in my main dialog without a titlbar. On WinXP the system buttons Close,Maximize and Minimize are visible, on Win7 they are missing. Any solution for that ?

Code: Select all

....
CJCOMMANDBARS oCommandbar ;
       PARENT oDialogM ;
       EVAL {|o|_StartRibbon(o), ;
                oStatusbar:=_BuildStatusBar(o), ;
                o:execute := {|o|PostAppEvent(xbeP_User+111,o)} }

DCUSEREVENT xbeP_User+111 ACTION {|a,b,o| MenuSelect(a,oStatusbar,oTaskpanel,oDialogM,oCmdGlobSett,oMainSkin,cMainSkin,oCommandbar) }
.....
DCGETOPTIONS RESIZE PIXEL ;
      WINDOWHEIGHT area[4] ;
      WINDOWWIDTH area[3] ;
      WINDOWROW aSizeDesktop[2]-area[4] ;
      CLOSEQUERY MSG {|| AppMainQuit(1,.T.) } ;
      ABORTQUERY MSG {|| AppMainQuit(1,.F.) } ;
      NOTITLEBAR ;
      HIDE


Re: RibbonBar and Win7

Posted: Mon Feb 22, 2010 8:32 am
by rdonnay
You didn't give me enough code to compile and run.

I tried changing my sample program to have no titlebar, and when I do, it "has no titlebar", so there are NO system buttons.

This is true for XP and Win 7.

I would need more code from you to understand what you are talking about.

Re: RibbonBar and Win7

Posted: Mon Feb 22, 2010 8:55 am
by Wolfgang Ciriack
Ok, i try do extract an example.

Re: RibbonBar and Win7

Posted: Wed Feb 24, 2010 3:50 pm
by Auge_Ohr
hi,

did you try to play with EnableOffice2007Frame(.T./.F.) ?

greetings by OHR
Jimmy

Re: RibbonBar and Win7

Posted: Wed Feb 24, 2010 6:14 pm
by rdonnay
did you try to play with EnableOffice2007Frame(.T./.F.) ?
Yes, everytime I used it, the app would lockup.

Re: RibbonBar and Win7

Posted: Thu Feb 25, 2010 12:41 am
by Auge_Ohr
rdonnay wrote:
did you try to play with EnableOffice2007Frame(.T./.F.) ?
Yes, everytime I used it, the app would lockup.
hm ... when using Office2007 Theme only or with 2003 Style too ?
if using 2007 Style you have to use :EnableFrameTheme() too

Code: Select all

METHOD VOBWORK:InitMenuBar()
LOCAL oQAccess
LOCAL oControl
LOCAL oPopUp
LOCAL oSBar
LOCAL oPane
LOCAL SwitchPane
LOCAL oAddSub
LOCAL oTabGroup
LOCAL xxx

   //
   // Office 2007 Style
   //
   ::oCbarS:EnableOffice2007Frame(.T.)
   //
   // using iTunes must set to .F. else Titlebutton are XP
   //
*  ::oCbarS:EnableOffice2007Frame(.F.)

   ::oRibbonBar := ::oCbarS:AddRibbonBar("Ribbon Bar")
   ::oRibbonBar:Title := "das ist eine Ribbonbar"
   ::oRibbonBar:EnableAnimation     := .F.
   //
   // strech it
   //
*  ::oRibbonBar:ClientHeight        := 30
*  ::oRibbonBar:GroupsHeight        := 80
   ::oRibbonBar:enableDocking(xtpFlagStretched)

   //
   // Icon only
*  ::oRibbonBar:DefaultButtonStyle := xtpButtonIcon
   // Icon with Caption
*  ::oRibbonBar:DefaultButtonStyle := xtpButtonIconAndCaption
   // Icon with Caption below Icon
   ::oRibbonBar:DefaultButtonStyle := xtpButtonIconAndCaptionBelow
   //
   // NOT if iTunes
   //
   ::oRibbonBar:EnableFrameTheme()              // Office2007
   ::oRibbonBar:ShowCaptionAlways := .F.

   //
   // add Imagelist
   //
   ::oRibbonBar:CommandBars:Icons  := ::oImageList:Icons

   //
   // which visual Theme
   //
*  ::oRibbonBar:CommandBars:VisualTheme := xtpThemeOffice2000
*  ::oRibbonBar:CommandBars:VisualTheme := xtpThemeOfficeXP
*  ::oRibbonBar:CommandBars:VisualTheme := xtpThemeOffice2003
*  ::oRibbonBar:CommandBars:VisualTheme := xtpThemeNativeWinXP
*  ::oRibbonBar:CommandBars:VisualTheme := xtpThemeWhidbey
*  ::oRibbonBar:CommandBars:VisualTheme := xtpThemeOffice2007
   ::oRibbonBar:CommandBars:VisualTheme := xtpThemeRibbon

   //
   // QuickAccess are beside Systembutton
   //
*   ::oRibbonBar:ShowQuickAccess  := .T.
*   ::oRibbonBar:ShowQuickAccessBelowRibbon := .F.
*   ::oRibbonBar:AllowMinimize    := .T.
*   ::oRibbonBar:Minimized        := .F.

*   oQAccess := ::oRibbonBar:QuickAccessControls
*   oQAccess:Add( xtpControlButton, ID_FILE_PRINT_PREVIEW, "")
*   oQAccess:Add( xtpControlButton, ID_FILE_SAVE         , "")
*   oQAccess:Item(1):Height := 20


*  ::oRibbonBar:SetIconSize(32,32)
   ::oRibbonBar:CommandBars:Options:LargeIcons         := .F.
   ::oRibbonBar:CommandBars:Options:ShowTextBelowIcons := .T.
   ::oRibbonBar:CommandBars:Options:Animation          := xtpAnimateNone
   ::oRibbonBar:CommandBars:Options:IconsWithShadow    := .T.
   ::oRibbonBar:CommandBars:Options:WrapLargePopups    := .T.

Re: RibbonBar and Win7

Posted: Thu Feb 25, 2010 12:56 am
by skiman
Hi Jimmy,

How do you handle the drawingarea?
When using the :enableFrameTheme we have a problem in defining the height of the drawingarea.

Re: RibbonBar and Win7

Posted: Thu Feb 25, 2010 1:26 am
by Auge_Ohr
skiman wrote:How do you handle the drawingarea?
When using the :enableFrameTheme we have a problem in defining the height of the drawingarea.
i "think" i have post that Problem and Solution with 1st Ribbenbar Sample from XCodejock ... i have to search again.

but in most case i do not use :drawingarea as i use RibbonTabGroup and like Tab-Header it does not have a "Body" like XbpTabpage.
So i have to "attach" a XbpStatic to the RibbonTabGroup "Header" while Size is :DrawingArea := oDialog:CurrentSize() - "Header":high / :wide with Position {0,0} on :DrawingArea.

Re: RibbonBar and Win7

Posted: Thu Feb 25, 2010 5:58 am
by skiman
Hi Jimmy,

The system that Roger implemented in xCodeJock is working in all the samples. Only when the quick access bar is on the titlebar there is a problem.

I suspect that the height of the ribbonbar is calculated wrong, because of the position on the titlebar.

Re: RibbonBar and Win7

Posted: Fri Feb 26, 2010 7:16 am
by Auge_Ohr
Auge_Ohr wrote:i "think" i have post that Problem and Solution with 1st Ribbenbar Sample from XCodejock ... i have to search again.
ok this is what i meen
28.01.09
From: "Roger Donnay" <rogerdonnay@donnay-software.com>

Ok, I now understand what you are trying to do.
Here is some updated code that uses all PIXEL coordinates.
It is much easier to do what you want when not using the FIT clause of DCREAD GUI and instead using the WINDOWHEIGHT clause of DCGETOPTIONS.

///////////////////////////////////////////////////////////////////////////////
//
// Ribbonbar / StatusBar with Xbase++ and eXPress++ // // Notes:
//
///////////////////////////////////////////////////////////////////////////////

#INCLUDE "dcdialog.CH"
#INCLUDE "XCodeJock.CH"
#INCLUDE "CommandBars.CH"

#define ID_INDICATOR_CAPS 59137
#define ID_INDICATOR_NUM 59138
#define ID_INDICATOR_SCRL 59139

PROC appsys ; RETURN

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

FUNCTION Main()

LOCAL Getlist[0], Getoptions, oCommandBar, oStatic

DCCJCOMMANDBARS oCommandbar ;
VISUALTHEME xtpThemeOfficeXP ;
EXECUTE {|o|_Execute(o,oStatic)} ;
EVAL {|o|_BuildRibbon(o)} ;
RESIZE DCGUI_RESIZE_REPOSONLY_Y

@ 175,0 DCSAY '' OBJECT oStatic COLOR GRA_CLR_RED, GRA_CLR_WHITE ;
SIZE 500, 275 FONT '24.Arial Bold' SAYWORDBREAK ;
RESIZE DCGUI_RESIZE_RESIZEONLY

DCGETOPTIONS RESIZE WINDOWHEIGHT 500 WINDOWWIDTH 500 PIXEL

DCREAD GUI TITLE 'CodeJock Command Bar w/Ribbon' OPTIONS GetOptions // FIT

RETURN nil

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

STATIC FUNCTION _BuildRibbon( oCommandBar )

Local oRibbonBar, oCommandBarControl, oPopUp, oTab1, oTab2, oCommandBarPopup, ;
oPane, oSBar

oCommandBar:add('commandbar',xtpBarTop)

CJAddRibbonBar oRibbonBar NAME 'RibbonBar1' PARENT oCommandBar
oRibbonBar:enableDocking(xtpFlagStretched)

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

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

oPopUp := oCommandBarControl:CommandBar:Controls
oPopUp:Add(xtpControlButton, 1, "&New")
oPopUp:Add(xtpControlButton, 2, "&Edit")

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

oTab1 := oRibbonBar:InsertTab(0, "&Write")
oTab2 := oRibbonBar:InsertTab(0, "&Read")

* --- Status Bar ---

oSBar := oRibbonBar:CommandBars:StatusBar()
oSBar:Visible := .T.

oPane := oSBar:AddPane(0)
oPane:Style := SBPS_STRETCH // Or SBPS_NOBORDERS oPane:Text := "Ready"
oPane:Width := 0 // Auto Size

// Adds the special Caps lock indicator pane oSBar:AddPane (ID_INDICATOR_CAPS) // Adds the special Num lock indicator pane oSBar:AddPane (ID_INDICATOR_NUM ) // Adds the special Scroll lock indicator pane oSBar:AddPane (ID_INDICATOR_SCRL)

return nil

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

STATIC FUNCTION _execute( oPopup, oStatic )

LOCAL cMessage

IF oPopup:id == 1
cMessage := 'New 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) ENDIF

RETURN nil