RibbonBar and Win7

This forum is for support of XCodeJock
Message
Author
Wolfgang Ciriack
Posts: 479
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

RibbonBar and Win7

#1 Post 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

_______________________
Best Regards
Wolfgang

User avatar
rdonnay
Site Admin
Posts: 4728
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: RibbonBar and Win7

#2 Post 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.
The eXpress train is coming - and it has more cars.

Wolfgang Ciriack
Posts: 479
Joined: Wed Jan 27, 2010 10:25 pm
Location: Berlin Germany

Re: RibbonBar and Win7

#3 Post by Wolfgang Ciriack »

Ok, i try do extract an example.
_______________________
Best Regards
Wolfgang

User avatar
Auge_Ohr
Posts: 1406
Joined: Wed Feb 24, 2010 3:44 pm

Re: RibbonBar and Win7

#4 Post by Auge_Ohr »

hi,

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

greetings by OHR
Jimmy
greetings by OHR
Jimmy

User avatar
rdonnay
Site Admin
Posts: 4728
Joined: Wed Jan 27, 2010 6:58 pm
Location: Boise, Idaho USA
Contact:

Re: RibbonBar and Win7

#5 Post by rdonnay »

did you try to play with EnableOffice2007Frame(.T./.F.) ?
Yes, everytime I used it, the app would lockup.
The eXpress train is coming - and it has more cars.

User avatar
Auge_Ohr
Posts: 1406
Joined: Wed Feb 24, 2010 3:44 pm

Re: RibbonBar and Win7

#6 Post 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.
greetings by OHR
Jimmy

skiman
Posts: 1184
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: RibbonBar and Win7

#7 Post 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.
Best regards,

Chris.
www.aboservice.be

User avatar
Auge_Ohr
Posts: 1406
Joined: Wed Feb 24, 2010 3:44 pm

Re: RibbonBar and Win7

#8 Post 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.
greetings by OHR
Jimmy

skiman
Posts: 1184
Joined: Thu Jan 28, 2010 1:22 am
Location: Sijsele, Belgium
Contact:

Re: RibbonBar and Win7

#9 Post 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.
Best regards,

Chris.
www.aboservice.be

User avatar
Auge_Ohr
Posts: 1406
Joined: Wed Feb 24, 2010 3:44 pm

Re: RibbonBar and Win7

#10 Post 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
greetings by OHR
Jimmy

Post Reply