Announcement

Collapse
No announcement yet.

Rebar Control

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Rebar Control

    Does anyone have some code that uses the Rebar control?? If so could you email it to me or post it on the BBS.
    Thanks A Bunch
    Kevin

    -------------
    mailto:[email protected][email protected]</A>
    :-)


  • #2
    This is part of a new version of PBNOTE that I'm working on:
    Code:
    FUNCTION BuildRebar(BYVAL hWnd AS LONG) AS LONG
     
      LOCAL hRebar   AS LONG
      LOCAL hIml     AS LONG
      LOCAL rbi      AS REBARINFO
      LOCAL rb       AS REBARBANDINFO
      LOCAL hBmp     AS LONG
      LOCAL hToolbar AS LONG
      LOCAL hImlBmp  AS LONG
     
      DIM tbb(0 to 8) AS TBBUTTON
     
      ' Fill the TBBUTTON array with button information
      tbb(0).iBitmap   = 0
      tbb(0).idCommand = %IDM_NEW
      tbb(0).fsState   = %TBSTATE_ENABLED
      tbb(0).fsStyle   = %TBSTYLE_BUTTON
      tbb(0).dwData    = 0
      tbb(0).iString   = 0
     
      tbb(1).iBitmap   = 1
      tbb(1).idCommand = %IDM_OPEN
      tbb(1).fsState   = %TBSTATE_ENABLED
      tbb(1).fsStyle   = %TBSTYLE_BUTTON
      tbb(1).dwData    = 0
      tbb(1).iString   = 0
     
      tbb(2).iBitmap   = 2
      tbb(2).idCommand = %IDM_SAVE
      tbb(2).fsState   = %TBSTATE_ENABLED
      tbb(2).fsStyle   = %TBSTYLE_BUTTON
      tbb(2).dwData    = 0
      tbb(2).iString   = 0
     
      tbb(3).iBitmap   = 0
      tbb(3).idCommand = 0
      tbb(3).fsState   = %TBSTATE_ENABLED
      tbb(3).fsStyle   = %TBSTYLE_SEP
      tbb(3).dwData    = 0
      tbb(3).iString   = 0
     
      tbb(4).iBitmap   = 3
      tbb(4).idCommand = %IDM_SAVE
      tbb(4).fsState   = %TBSTATE_ENABLED
      tbb(4).fsStyle   = %TBSTYLE_BUTTON
      tbb(4).dwData    = 0
      tbb(4).iString   = 0
     
      tbb(5).iBitmap   = 0
      tbb(5).idCommand = 0
      tbb(5).fsState   = %TBSTATE_ENABLED
      tbb(5).fsStyle   = %TBSTYLE_SEP
      tbb(5).dwData    = 0
      tbb(5).iString   = 0
     
      tbb(6).iBitmap   = 4
      tbb(6).idCommand = %IDM_CUT
      tbb(6).fsState   = %TBSTATE_ENABLED
      tbb(6).fsStyle   = %TBSTYLE_BUTTON
      tbb(6).dwData    = 0
      tbb(6).iString   = 0
     
      tbb(7).iBitmap   = 5
      tbb(7).idCommand = %IDM_COPY
      tbb(7).fsState   = %TBSTATE_ENABLED
      tbb(7).fsStyle   = %TBSTYLE_BUTTON
      tbb(7).dwData    = 0
      tbb(7).iString   = 0
     
      tbb(8).iBitmap   = 6
      tbb(8).idCommand = %IDM_PASTE
      tbb(8).fsState   = %TBSTATE_ENABLED
      tbb(8).fsStyle   = %TBSTYLE_BUTTON
      tbb(8).dwData    = 0
      tbb(8).iString   = 0
     
      ' Create the Coolbar window
      hRebar = CreateRebar(hWnd, %WS_VISIBLE OR _
                                 %WS_BORDER OR _
                                 %WS_CHILD OR _
                                 %WS_CLIPCHILDREN OR _
                                 %WS_CLIPSIBLINGS OR _
                                 %RBS_BANDBORDERS OR _
                                 %CCS_NODIVIDER OR _
                                 %CCS_NOPARENTALIGN, _
                           0, 0, 400, 24, %ID_COOLBAR, hInst)
     
      hToolbar = CreateToolbarEx(hRebar, %WS_CHILD OR _
                                         %WS_BORDER OR _
                                         %WS_VISIBLE OR _
                                         %TBSTYLE_TOOLTIPS OR _
                                         %TBSTYLE_FLAT OR _
                                         %CCS_NODIVIDER OR _
                                         %CCS_TOP, _
                                         %ID_TOOLBAR, _
                                 0, hInst, %NULL, BYVAL %NULL, 0, 16, 16, 16, 16, LEN(TBBUTTON))
     
      hBmp = ImageList_LoadBitmap(hInst, "TOOLBAR", 16, 0, %CLR_NONE)
      SendMessage hToolbar, %TB_SETBITMAPSIZE, 0, MAKLNG(16,16)
      SendMessage hToolbar, %TB_SETIMAGELIST, 0, hBmp
      SendMessage hToolbar, %TB_ADDBUTTONS, 9, VARPTR(tbb(0))
     
      rb.cbSize     = SIZEOF(rb)
      rb.fMask      = %RBBIM_CHILD OR %RBBIM_CHILDSIZE OR %RBBIM_ID OR %RBBIM_STYLE OR %RBBIM_COLORS
      rb.clrFore    = GetSysColor(%COLOR_BTNTEXT)
      rb.clrBack    = GetSysColor(%COLOR_BTNFACE)
      rb.fStyle     = %RBBS_NOVERT OR %RBBS_CHILDEDGE OR %RBBS_FIXEDSIZE OR %RBBS_GRIPPERALWAYS
      rb.hWndChild  = hToolbar
      rb.wID        = %ID_TOOLBAR
      rb.cxMinChild = 16
      rb.cyMinChild = 18
     
      SendMessage hRebar, %RB_INSERTBAND, -1, VARPTR(rb)
     
      FUNCTION = hRebar
     
    END FUNCTION
    --Dave


    -------------
    PowerBASIC Support
    mailto:[email protected][email protected]</A>

    Home of the BASIC Gurus
    www.basicguru.com

    Comment


    • #3
      Thanks Dave
      That tidbit of code helped me figure out what I was missing.
      BTW the newest version commctrl.inc does not have the
      CreateRebar() declare in it but an older version does (date 7-2-99)
      Thanks again
      Kevin Voell

      -------------
      mailto:[email protected]mail.com[email protected]</A>
      :-)

      Comment


      • #4
        Dumb question: What's a rebar? Er, what would I know it as other than Rebar?

        Scott

        -------------
        Scott Turchin


        Scott Turchin
        MCSE, MCP+I
        http://www.tngbbs.com
        ----------------------
        True Karate-do is this: that in daily life, one's mind and body be trained and developed in a spirit of humility; and that in critical times, one be devoted utterly to the cause of justice. -Gichin Funakoshi

        Comment


        • #5
          A rebar is the thing in IE4 where you can move the toolbars around

          Regards

          -------------
          Daniel
          [email protected]

          Comment


          • #6
            Kevin,

            I looked in the system comctl32.dll and the export table makes no reference
            to CreateRebar() function. This has obviously been an MS decision to exclude this function. (NT4.0 sp6)

            Dave,

            Where is this function located in the system environment now? I looked in
            several *.dll's with no avail.

            Cecil

            Comment


            • #7
              A rebar is a child window that can hold other controls such as toolbars, menus, listview boxes, animation controls, etc. that can be resized and relocated by grabbing the "BAND". You have probably seen them in IE4 or visual studio or WORD.


              Kevin

              -------------
              mailto:[email protected][email protected]</A>
              :-)

              Comment


              • #8
                Cecil,
                Actually the "microsoft" way of creating a rebar is to use the CreateWindowEx function and use the REBARCLASSNAME. It is just that PowerBASIC encapsulated that call into one called CreateRebar() in the early versions of the Commctrl.inc. but one could just as easily use the createwindowex function in PB. It is just I had some earlier code that used the CreateRebar and when I came back to it a year later it would not work and I could not figure out why.
                Kevin

                -------------
                mailto:[email protected][email protected]</A>
                :-)

                Comment


                • #9
                  Kevin,

                  I see now. I create this type of toolbar in AutoCAD all the time, allbeit
                  a different process.

                  What threw me was Dave's code using this function. Since I'm somewhat
                  new to Win32 programming, I was looking for the function location in PB
                  inc's first then system dll's. I was not aware of the previous wrapper
                  function.

                  Cheers,
                  Cecil

                  Comment


                  • #10
                    Code:
                    FUNCTION CreateRebar(BYVAL hParent AS LONG, BYVAL Style AS LONG, _
                                         BYVAL x AS LONG, BYVAL y AS LONG, BYVAL w AS LONG, BYVAL h AS LONG, _
                                         BYVAL id AS LONG, BYVAL hInst AS LONG) AS LONG
                      FUNCTION = CreateWindowEx(%WS_EX_TOOLWINDOW, "ReBarWindow32", BYVAL %NULL, Style, x, y, w, h, hParent, Id, hInst, BYVAL %NULL)
                    END FUNCTIO
                    --Dave


                    -------------
                    PowerBASIC Support
                    mailto:[email protected][email protected]</A>

                    Home of the BASIC Gurus
                    www.basicguru.com

                    Comment


                    • #11
                      kevin, scott,

                      here is a port-over i just did for fun. check out the link to the application note.

                      http://www.powerbasic.com/support/pb...ad.php?t=22562


                      if you need the bitmaps, give me a jingle. mailto:[email protected][email protected]</a>

                      regards, jules
                      Best regards
                      Jules
                      www.rpmarchildon.com

                      Comment

                      Working...
                      X