Author | Topic: Tabpage | |
---|---|---|
AUGE_OHR | Tabpage on Tue, 02 Jun 2009 16:25:11 +0200 hi, with SL1 (v35x) oTabpage:typ := XBPTABPAGE_TAB_BOTTOM does not respect "visual Style". as i remember it work with v347 ... *** quote *** #include "Gra.ch" #include "Xbp.ch" #include "Common.ch" #include "Appevent.ch" #include "Font.ch" #define DRAW_HEADERFG 1 #define DRAW_HEADERBG 2 #define DRAW_BODYFG 4 #define DRAW_BODYBG 8 STATIC DrawMode := -1 CLASS NewForm FROM _NewForm EXPORTED: METHOD init METHOD create ENDCLASS METHOD NewForm:init( oParent, oOwner, aPos, aSize, aPP, lVisible ) * Execute method of the super class ::_NewForm:init( oParent, oOwner, aPos, aSize, aPP, lVisible ) RETURN self METHOD NewForm:create( oParent, oOwner, aPos, aSize, aPP, lVisible ) * Execute method of the super class ::_NewForm:create( oParent, oOwner, aPos, aSize, aPP, lVisible ) * Display the form ::show() RETURN self proc appsys() return ****************************************************************************** * Main procedure to test a form ****************************************************************************** PROCEDURE Main LOCAL nEvent, oXbp, mp1, mp2, oDlg odlg := NewForm():New() odlg:Title := "Tabpage Style Parts" odlg:Create() oDlg:cmDrawMode:AddItem( "XBP_DRAW_NORMAL" ) oDlg:cmDrawMode:AddItem( "XBP_DRAW_OWNER" ) oDlg:cmDrawMode:AddItem( "XBP_DRAW_OWNERADVANCED" ) oDlg:cmDrawMode:SetData( {1} ) oDlg:cmDrawMode:ItemSelected := {|| DrawModeSelected(oDlg:cmDrawMode)} oDlg:cbUseStyle:Selected := {|| UseStyleSelected(oDlg:cbUseStyle)} oDlg:cbHeaderDrawFG:Selected := {|| DrawCheckSelected(oDlg:cbHeaderDrawFG, DRAW_HEADERFG)} oDlg:cbHeaderDrawBG:Selected := {|| DrawCheckSelected(oDlg:cbHeaderDrawBG, DRAW_HEADERBG)} oDlg:cbBodyDrawFG:Selected := {|| DrawCheckSelected(oDlg:cbBodyDrawFG, DRAW_BODYFG)} oDlg:cbBodyDrawBG:Selected := {|| DrawCheckSelected(oDlg:cbBodyDrawBG, DRAW_BODYBG)} oDlg:TabPage1:Draw := {|o,a| DrawTab(o, a)} nEvent := xbe_None WHILE nEvent != xbeP_Close nEvent := AppEvent ( @mp1, @mp2, @oXbp ) oXbp:HandleEvent ( nEvent, mp1, mp2 ) IF nEvent == xbeP_Quit QUIT AppQuit() ENDIF ENDDO RETURN PROCEDURE DrawModeSelected( oCombo ) LOCAL nItem := oCombo:GetData()[1] DO CASE CASE nItem == 1 GetParentForm(oCombo):TabPage1:DrawMode := XBP_DRAW_NORMAL GetParentForm(oCombo):cbHeaderDrawFG:Disable() GetParentForm(oCombo):cbHeaderDrawBG:Disable() GetParentForm(oCombo):cbBodyDrawFG:Disable() GetParentForm(oCombo):cbBodyDrawBG:Disable() CASE nItem == 2 GetParentForm(oCombo):TabPage1:DrawMode := XBP_DRAW_OWNER GetParentForm(oCombo):cbHeaderDrawFG:Enable() CASE nItem == 3 GetParentForm(oCombo):TabPage1:DrawMode := XBP_DRAW_OWNERADVANCED GetParentForm(oCombo):cbHeaderDrawFG:Enable() GetParentForm(oCombo):cbHeaderDrawBG:Enable() GetParentForm(oCombo):cbBodyDrawBG:Enable() GetParentForm(oCombo):cbBodyDrawFG:Enable() ENDCASE GetParentForm(oCombo):TabPage1:Configure() RETURN PROCEDURE UseStyleSelected( oCheck ) GetParentForm(oCheck):TabPage1:UseVisualStyle := oCheck:GetData() GetParentForm(oCheck):TabPage1:InvalidateRect() RETURN PROCEDURE DrawCheckSelected( oCheck, nFlag ) IF oCheck:GetData() == .T. DrawMode := BOr( DrawMode, nFlag ) ELSE DrawMode := BXOr( DrawMode, nFlag ) ENDIF GetParentForm(oCheck):TabPage1:Hide() GetParentForm(oCheck):TabPage1:Show() RETURN FUNCTION DrawTab( oPS, aInfo ) LOCAL lHeader := BAnd(aInfo[XBP_DRAWINFO_STATE],XBP_DRAWSTATE_HEADER) == XBP_DRAWSTATE_HEADER LOCAL nFG LOCAL nBG LOCAL lReturn := .T. LOCAL aAttrs IF lHeader == .T. nFG := DRAW_HEADERFG nBG := DRAW_HEADERBG ELSE nFG := DRAW_BODYFG nBG := DRAW_BODYBG ENDIF IF BAnd(aInfo[XBP_DRAWINFO_ACTION],XBP_DRAWACTION_DRAWBG) == XBP_DRAWACTION_DRAWBG .AND.; BAnd(DrawMode, nBG) == 0 lReturn := .F. ENDIF IF BAnd(aInfo[XBP_DRAWINFO_ACTION],XBP_DRAWACTION_DRAWFG) == XBP_DRAWACTION_DRAWFG .AND.; BAnd(DrawMode, nFG) == 0 lReturn := .F. ENDIF IF lReturn == .F. aAttrs := Array( GRA_AA_COUNT ) aAttrs[GRA_AA_COLOR] := GRA_CLR_RED aAttrs[GRA_AA_SYMBOL] := GRA_SYM_DIAG2 GraSetAttrArea( oPS, aAttrs ) GraBox( oPS,{aInfo[XBP_DRAWINFO_RECT][1],aInfo[XBP_DRAWINFO_RECT][2]},; {aInfo[XBP_DRAWINFO_RECT][3],aInfo[XBP_DRAWINFO_RECT][4]}, ; GRA_OUTLINEFILL ) ENDIF RETURN lReturn *********************************************************************************************** * Include program code for the implementation-level class of the form #include "_TESTCASE.PRG" found in \preview.xbase++.servicelevel1 #ifndef NEWFORM #define NEWFORM #include "Gra.ch" #include "Xbp.ch" #include "Common.ch" #include "Appevent.ch" #include "Font.ch" #PRAGMA LIBRARY( "ASCOM10.LIB" ) CLASS _NewForm FROM XbpDialog EXPORTED: VAR editControls * Contained control elements VAR cmDrawMode VAR TabPage1 VAR cbUseStyle VAR cbHeaderDrawFG VAR cbHeaderDrawBG VAR cbBodyDrawFG VAR cbBodyDrawBG METHOD init METHOD create ENDCLASS ****************************************************************************** * Initialize form ****************************************************************************** METHOD _NewForm:init( oParent, oOwner, aPos, aSize, aPP, lVisible ) LOCAL aDASize :={456,362} LOCAL aPres3 := {{ XBP_PP_ORIGIN, XBP_ORIGIN_TOPLEFT},; { XBP_PP_FGCLR, GRA_CLR_BLACK } ,; { XBP_PP_BGCLR, GraMakeRGBColor( { 229, 242, 255 } ) } } LOCAL aPres4 := {{ XBP_PP_ORIGIN, XBP_ORIGIN_TOPLEFT},; { XBP_PP_FGCLR, GRA_CLR_BLACK } ,; { XBP_PP_BGCLR, GraMakeRGBColor( { 204, 229, 254 } ) } } LOCAL aPres5 := {{ XBP_PP_ORIGIN, XBP_ORIGIN_TOPLEFT},; { XBP_PP_FGCLR, GRA_CLR_BLACK } ,; { XBP_PP_BGCLR, GraMakeRGBColor( { 153, 203, 255 } ) } } DEFAULT oParent TO AppDesktop(), ; aPos TO {100,200}, ; aSize TO {0,0}, ; lVisible TO .F. DEFAULT aPP TO {} AAdd ( aPP, { XBP_PP_COMPOUNDNAME, "8.Arial" } ) ::XbpDialog:init( oParent, oOwner, aPos, aSize, aPP, lVisible ) ::XbpDialog:drawingArea:clipChildren := .F. ::XbpDialog:clientSize := aDASize ::XbpDialog:taskList := .T. ::XbpDialog:title := "New form" ::editControls := {} ::cmDrawMode := XbpCombobox():new( ::drawingArea, , {296,236}, {136,80}, { { XBP_PP_BGCLR, XBPSYSCLR_ENTRYFIELD } } ) ::cmDrawMode:tabstop := .T. ::cmDrawMode:type := XBPCOMBO_DROPDOWNLIST * ::TabPage1 := XbpTabPage():new( ::drawingArea, , {16,36}, {260,304}, { { XBP_PP_BGCLR, XBPSYSCLR_BUTTONMIDDLE } } ) ::TabPage1 := XbpTabPage():new( ::drawingArea, , {16,36}, {260,304}, aPres3 ) ::TabPage1:caption := "TabPage" ::TabPage1:minimized := .F. ::TabPage1:postOffset := 75 ::TabPage1:tabStop := .T. ::TabPage1:type := XBPTABPAGE_TAB_BOTTOM * ::cbUseStyle := XbpCheckBox():new( ::drawingArea, , {296,216}, {136,20}, { { XBP_PP_BGCLR, -255 } } ) ::cbUseStyle := XbpCheckBox():new( ::TabPage1, , {26,216}, {136,20}, { { XBP_PP_BGCLR, -255 } } ) ::cbUseStyle:caption := "Use Visual Style" ::cbUseStyle:selection := .T. ::cbUseStyle:tabStop := .T. ::cbUseStyle:selected := {|| NIL } * ::cbHeaderDrawFG := XbpCheckBox():new( ::drawingArea, , {296,172}, {136,20}, { { XBP_PP_BGCLR, -255 } } ) ::cbHeaderDrawFG := XbpCheckBox():new( ::TabPage1, , {26,172}, {136,20}, { { XBP_PP_BGCLR, -255 } } ) ::cbHeaderDrawFG:caption := "Header: Draw FG" ::cbHeaderDrawFG:selection := .T. ::cbHeaderDrawFG:tabStop := .T. ::cbHeaderDrawFG:selected := {|| NIL } * ::cbHeaderDrawBG := XbpCheckBox():new( ::drawingArea, , {296,144}, {136,20}, { { XBP_PP_BGCLR, -255 } } ) ::cbHeaderDrawBG := XbpCheckBox():new( ::TabPage1, , {26,144}, {136,20}, { { XBP_PP_BGCLR, -255 } } ) ::cbHeaderDrawBG:caption := "Header: Draw BG" ::cbHeaderDrawBG:selection := .T. ::cbHeaderDrawBG:tabStop := .T. ::cbHeaderDrawBG:selected := {|| NIL } * ::cbBodyDrawFG := XbpCheckBox():new( ::drawingArea, , {296,112}, {136,20}, { { XBP_PP_BGCLR, -255 } } ) ::cbBodyDrawFG := XbpCheckBox():new( ::TabPage1, , {26,112}, {136,20}, { { XBP_PP_BGCLR, -255 } } ) ::cbBodyDrawFG:caption := "Body: Draw FG" ::cbBodyDrawFG:selection := .T. ::cbBodyDrawFG:tabStop := .T. ::cbBodyDrawFG:selected := {|| NIL } * ::cbBodyDrawBG := XbpCheckBox():new( ::drawingArea, , {296,84}, {136,20}, { { XBP_PP_BGCLR, -255 } } ) ::cbBodyDrawBG := XbpCheckBox():new( ::TabPage1, , {26, 84}, {136,20}, { { XBP_PP_BGCLR, -255 } } ) ::cbBodyDrawBG:caption := "Body: Draw BG" ::cbBodyDrawBG:selection := .T. ::cbBodyDrawBG:tabStop := .T. ::cbBodyDrawBG:selected := {|| NIL } RETURN self ****************************************************************************** * Request system resources ****************************************************************************** METHOD _NewForm:create( oParent, oOwner, aPos, aSize, aPP, lVisible ) ::XbpDialog:create( oParent, oOwner, aPos, aSize, aPP, lVisible ) ::cmDrawMode:create() ::TabPage1:create() ::cbUseStyle:create() ::cbHeaderDrawFG:create() ::cbHeaderDrawFG:disable() ::cbHeaderDrawBG:create() ::cbHeaderDrawBG:disable() ::cbBodyDrawFG:create() ::cbBodyDrawFG:disable() ::cbBodyDrawBG:create() ::cbBodyDrawBG:disable() RETURN self #endif //EOF ///// *** eof *** greetings by OHR Jimmy | |
AUGE_OHR | Re: Tabpage on Tue, 02 Jun 2009 18:41:43 +0200 hi seems that SL1 "visual Style" XbpTabpage does not react on Codejock Skinframework ? no "skinning" possble (or wrong XLLSYS.DLL) ? greetings by OHR Jimmy | |
AUGE_OHR | Re: Tabpage on Wed, 03 Jun 2009 05:33:26 +0200 attached Picture was made from v355 Version "without visual Style" (now avaiable at Alaska Website) it show "orange" Litebar on the Tab at XBPTABPAGE_TAB_BOTTOM it looks a little bit funny, but it "works". at XBPTABPAGE_TAB_TOP you can "see" some missing Pixel from Frame while Tab is on Bottom > seems that SL1 "visual Style" XbpTabpage does not react on Codejock > Skinframework ? no "skinning" possble (or wrong XLLSYS.DLL) ? not tested yet with v355 Version "without visual Style" greetings by OHR Jimmy v355Tabpage.JPG |