Page 1 of 1

Rebar in XP

PostPosted: Sun Jun 25, 2017 11:55 am
by byte-one
I found, that the control "rebar" is not further functioning on XP!
I use rpreview for years in XP. Now (with FWH 17.05) the rebar is not visible on XP.

Re: Rebar in XP

PostPosted: Mon Jun 26, 2017 6:42 am
by Antonio Linares
Please post a screenshot of how it used to look

Re: Rebar in XP

PostPosted: Mon Jun 26, 2017 6:57 am
by byte-one
Antonio, i have change the line in rpreview.prg
Code: Select all  Expand view
lRebar   := ( IsAppThemed() .and. Empty( nStyle ) .and. bUserBtns == nil .and. nBtnW == nil .and. nBtnH == nil )

to
Code: Select all  Expand view
lRebar   := .T.

Now you can see, that the rebar is not visible in XP!

Re: Rebar in XP

PostPosted: Tue Jun 27, 2017 2:08 am
by Antonio Linares
Please provide a small and self contained PRG to test on XP, thanks

Re: Rebar in XP

PostPosted: Wed Jun 28, 2017 7:49 am
by byte-one
It seems, that not rebar is the problem but rather the combination rebar-ttoolbar. Further tests are required.

Re: Rebar in XP

PostPosted: Wed Jun 28, 2017 9:58 am
by byte-one
I tested this code. DEFINE TOOLBAR is not functioning if the OF <owin> clausula is directed to oReBar!?

Code: Select all  Expand view
function Main()
    local oWnd , oReBar , oFactor , nFactor , oBar , oMenu , oImagelist
    DEFINE WINDOW oWnd TITLE "Test ReBar" COLOR CLR_BLACK,CLR_LIGHTGRAY MENU BuildMenu()

    oImageList = TImageList():New()
    oImageList:AddMasked( TBitmap():Define( , "C:\\fwh\bitmaps\16x16\new2.bmp", oWnd ),nRGB( 255, 0, 255 ) )
    oImageList:AddMasked( TBitmap():Define( , "C:\\fwh\bitmaps\16x16\open2.bmp", oWnd ),nRGB( 255, 0, 255 ) )

        oReBar := TReBar():New( oWnd )

    DEFINE TOOLBAR oBar OF oWnd SIZE 25, 25 IMAGELIST oImageList    //functioning
//  DEFINE TOOLBAR oBar OF oBar SIZE 25, 25 IMAGELIST oImageList    //functioning

//  DEFINE TOOLBAR oBar OF oRebar SIZE 25, 25 IMAGELIST oImageList  //NOT! functioning

    oReBar:InsertBand( oBar )
    DEFINE TBBUTTON OF oBar ACTION msginfo("Test 1")
    DEFINE TBSEPARATOR OF oBar
    DEFINE TBBUTTON OF oBar ACTION msginfo("Test 2")
    @ 5, 100 COMBOBOX oFactor VAR nFactor ITEMS { "1", "2", "3", "4", "5", "6", "7", "8", "9" } OF oBar PIXEL SIZE 35,200
    @ 5, 150 SAY "Test" SIZE 45, 15 PIXEL OF oBar
    FixSays( oBar:hWnd, GetStockObject( 0 ) )

    DEFINE STATUSBAR OF oWnd PROMPT "Test"

    ACTIVATE WINDOW oWnd
   oImageList:End()

return nil

function BuildMenu()
local oMenu
  MENU oMenu
      MENUITEM FWString( "Testmenu" )
      MENU
         MENUITEM "Menu 1"
         SEPARATOR
         MENUITEM "Menu 2"
      ENDMENU
  ENDMENU
return oMenu

Re: Rebar in XP

PostPosted: Thu Jun 29, 2017 4:59 am
by Antonio Linares
Günther,

Those controls are Windows standard classes and they may not accept to be used that way

Re: Rebar in XP

PostPosted: Thu Jun 29, 2017 5:47 pm
by byte-one
I come to the result, that REBARS not functioning as expected! (with grippers, more bands, etc.)
Is there a another class to containing other objects?

Re: Rebar in XP

PostPosted: Fri Jun 30, 2017 4:51 am
by Antonio Linares
> I come to the result, that REBARS not functioning as expected! (with grippers, more bands, etc.)

Please provide a PRG example to test what is not functioning right, thanks

> Is there a another class to containing other objects?

Most controls can contain other controls

Please review TBar or TPanel

Re: Rebar in XP

PostPosted: Fri Jun 30, 2017 7:58 am
by byte-one
I have tested with this code. You can switch REBAR on or off with the #define REBAR. But no bands are visible (WIN 10)
Code: Select all  Expand view
#define REBAR

function Main()
    local oWnd , oReBar , oFactor , nFactor , oBar , oMenu , oImagelist , oBar2
    DEFINE WINDOW oWnd TITLE "Test ReBar" COLOR CLR_BLACK,CLR_LIGHTGRAY MENU BuildMenu()

    oImageList = TImageList():New()
    oImageList:AddMasked( TBitmap():Define( , "C:\\fwh\bitmaps\16x16\new2.bmp", oWnd ),nRGB( 255, 0, 255 ) )
    oImageList:AddMasked( TBitmap():Define( , "C:\\fwh\bitmaps\16x16\open2.bmp", oWnd ),nRGB( 255, 0, 255 ) )

#ifdef REBAR
        oReBar := TReBar():New( oWnd )
#endif
    DEFINE TOOLBAR oBar OF oBar SIZE 25, 25 IMAGELIST oImageList
    DEFINE TBBUTTON OF oBar ACTION msginfo("Test 1")
    DEFINE TBSEPARATOR OF oBar
    DEFINE TBBUTTON OF oBar ACTION msginfo("Test 2")
    @ 5, 100 COMBOBOX oFactor VAR nFactor ITEMS { "1", "2", "3", "4", "5", "6", "7", "8", "9" } OF oBar PIXEL SIZE 35,200
    @ 5, 150 SAY "Test" SIZE 45, 15 PIXEL OF oBar
    FixSays( oBar:hWnd, GetStockObject( 0 ) )
#ifdef REBAR
    oReBar:InsertBand( oBar,"1" )

    DEFINE TOOLBAR oBar2 OF oBar2 SIZE 25, 25 IMAGELIST oImageList
    DEFINE TBBUTTON OF oBar2 ACTION msginfo("Test 1")
    oReBar:InsertBand( oBar2,"2" )
#endif

    DEFINE STATUSBAR OF oWnd PROMPT "Test"
    ACTIVATE WINDOW oWnd
   oImageList:End()

return nil

function BuildMenu()
local oMenu
  MENU oMenu
      MENUITEM FWString( "Testmenu" )
      MENU
         MENUITEM "Menu 1"
         SEPARATOR
         MENUITEM "Menu 2"
      ENDMENU
  ENDMENU
return oMenu