Announcement

Collapse
No announcement yet.

Transparent ToolBar?

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

  • Patrice Terrier
    replied
    Here again, The CanaryBay project has a custom scrolling toolbar that is able to display transparent images, and the full PowerBASIC source code is provided for free.

    Leave a comment:


  • Steve Hutchesson
    replied
    There is only one solution, BUY Axialis Icon Workshop. Have a few less cafe Latte's for a while and get the PRO version and from the occasional spam I get from them, the price has dropped as well so you won't have to go without so many cafe Latte's.

    Seriously though, being able to routinely create toolbar strips as PNG in 32 bit colour with transparency lets you do all sorts of things. With the PRO version you can get a heap of extra images that you can use to construct custom images of your own. Icons, buttons, any small images you need, a nice toy worth owning. PS I am a paying customer, not an advertiser.

    Leave a comment:


  • Anne Wilson
    replied
    Only drawback with this program is that the Toolbar.bmp contains a bunch of very ancient icons

    Leave a comment:


  • Anne Wilson
    replied
    Thanks so much Jim
    Brilliant

    Leave a comment:


  • Jim Fritts
    replied
    Click image for larger version  Name:	New Bitmap Image.jpg Views:	0 Size:	50.8 KB ID:	797995
    Code:
    'Modified from POFFS code by
    ''Jeffrey R. Radue
    ''posted January 05, 2001 06:09 PM
    
    'TOOLBAR.BMP is found in PBWIN70\SAMPLES\SDK\SKELETON
    'Start of program code
    'I thought this approach gave a really nice graphical button with flat transparent appearance.
    'When the mouse hovers over it, the button becomes raised.
    'Click each button to see WM_COMMAND reacting like any button would.
    'So far I only have what I wanted which is the TB_LIST option.
    'Thanks to Jeff Radue and POFFS by Borge.
    
    'Original app by Bob Mechler posted 23 AUG 2009
    'found here:
    'https://forum.powerbasic.com/forum/user-to-user-discussions/powerbasic-for-windows/42353-transparent-toolbar?p=495362#post495362
    
    'Updated by Jim Fritts on 2020-AUG-12 to run on PBWIN10 and J. Roca includes
    'Minor changes to Bob and Jeff's work. Additions have been made to refine the button sizes.
    'Thank you Bob, Jeff, and Borge!
    
    #COMPILE EXE "flatbut.exe"
    #REGISTER NONE
    #DIM ALL
    
    #RESOURCE BITMAP,     125, "TOOLBAR.BMP"     'id is 125   'Toolbar button strip image resource identifier
    
    GLOBAL ghInstance AS DWORD    ' handle of the application instance
    GLOBAL hBmp       AS LONG
    
    $INCLUDE "win32api.inc"
    $INCLUDE "comdlg32.inc"
    $INCLUDE "Commctrl.inc"
    
    %ID_TOOLBAR1  = 2033
    %ID_TOOLBAR2  = 2034
    %ID_TOOLBAR3  = 2035
    %ID_TOOLBAR4  = 2036
    %ID_TOOLBAR5  = 2037
    %ID_TOOLBAR6  = 2038
    %ID_TOOLBAR7  = 2039
    %ID_TOOLBAR8  = 2040
    %ID_TOOLBAR9  = 2041
    
    %TB_LIST      = 0    'flag
    %TB_STD_LIST  = 1    'flag
    %TB_BM_ONLY   = 2    'flag
    %TB_STD_BM    = 3    'flag
    
    %IDC_BUTTON1  = 100
    %IDC_BUTTON2  = 101
    %IDC_BUTTON3  = 102
    %IDC_BUTTON4  = 103
    %IDC_BUTTON5  = 104
    %IDC_BUTTON6  = 105
    %IDC_BUTTON7  = 106
    %IDC_BUTTON8  = 107
    %IDC_BUTTON9  = 108
    
    FUNCTION CreateFlatButton( _
               BYVAL hdlg AS LONG _
             , BYVAL TBID AS LONG _
             , BYVAL ctl AS LONG  _
             , BYVAL resID AS LONG _
             , TXT$                _
             , BYVAL x AS LONG     _
             , BYVAL y AS LONG     _
             , BYVAL wdth AS LONG  _
             , BYVAL hgt AS LONG   _
             , BYVAL flag AS LONG  _
             ) AS LONG
    
      LOCAL tb AS TBBUTTON
      LOCAL Tabm AS TBADDBITMAP
    
      Tb.iBitmap = resID
      Tb.fsState = %TBSTATE_ENABLED
      Tb.fsStyle = %TBSTYLE_BUTTON
      Tb.dwData = 0
      Tb.iString = 0
      Tb.idCommand = ctl
    
      SELECT CASE flag   'flag = %TB_LIST = 0, %TB_STD_LIST = 1, %TB_BM_ONLY = 2, %TB_STD_BM = 3
        CASE 0,1 'List Style, with text to the right
            CONTROL ADD _
                          "TOOLBARWINDOW32"     _
                        , hdlg                  _
                        , TBID                  _
                        , ""                    _
                        , x, y, wdth, hgt+4     _
                        , %WS_CHILD OR          _
                          %WS_VISIBLE OR        _
                          %CCS_NOPARENTALIGN OR _
                          %TBSTYLE_TOOLTIPS OR  _
                          %TBSTYLE_FLAT OR      _
                          %CCS_NORESIZE OR      _
                          %CCS_NODIVIDER OR     _
                          %TBSTYLE_LIST
    
            IF (flag= 0) THEN
                ' Use resource bitmaps
                '%TB_LIST
                Tabm.hInst = GetModuleHandle(BYVAL %NULL)
                Tabm.nID = 125 'refers to my multiple image toolbar bitmap mentioned above
                Tb.iBitmap = resID
            ELSE
                ' Use standard system bitmaps
                '%TB_STD_LIST
                Tabm.hInst = %HINST_COMMCTRL
                Tabm.nID = %IDB_STD_SMALL_COLOR
                Tb.iBitmap = resID
            END IF
    
            CONTROL SEND hdlg, TBID,%TB_SETBITMAPSIZE,0,MAKLNG(hgt,hgt)
            CONTROL SEND hdlg, TBID, %TB_ADDBITMAP,1, VARPTR(Tabm)
            CONTROL SEND hdlg, TBID, %TB_BUTTONSTRUCTSIZE, SIZEOF(Tb), 0
            CONTROL SEND hdlg, TBID, %TB_ADDBUTTONS,1, VARPTR(Tb)
            TXT$ = TXT$ & $NUL & $NUL
            CONTROL SEND hdlg, TBID, %TB_ADDSTRING, 0, STRPTR(TXT$)
    
        CASE ELSE ' No text, just a bitmap
            CONTROL ADD _
                          "TOOLBARWINDOW32"     _
                        , hdlg                  _
                        , TBID                  _
                        , ""                    _
                        , x, y, wdth, hgt       _
                        , %WS_CHILD OR          _
                          %WS_VISIBLE OR        _
                          %CCS_NOPARENTALIGN OR _
                          %TBSTYLE_TOOLTIPS OR  _
                          %TBSTYLE_FLAT OR      _
                          %CCS_NORESIZE OR      _
                          %CCS_NODIVIDER
    
            IF (flag= 2) THEN
                ' Use resource bitmaps
                '%TB_BM_ONLY
                Tabm.hInst = GetModuleHandle(BYVAL %NULL)
                Tabm.nID = 125 'refers to my multiple image toolbar bitmap mentioned above
                Tb.iBitmap = resID
            ELSE
                ' Use standard system bitmaps
                '%TB_STD_BM
                Tabm.hInst = %HINST_COMMCTRL
                Tabm.nID = %IDB_STD_SMALL_COLOR
                Tb.iBitmap = resID
            END IF
    
            CONTROL SEND hdlg, TBID,%TB_SETBITMAPSIZE,0,MAKLNG(hgt,hgt)
            CONTROL SEND hdlg, TBID, %TB_ADDBITMAP,1, VARPTR(Tabm)
            CONTROL SEND hdlg, TBID, %TB_BUTTONSTRUCTSIZE, SIZEOF(Tb), 0
            CONTROL SEND hdlg, TBID, %TB_ADDBUTTONS,1, VARPTR(Tb)
    
      END SELECT
      CONTROL SEND hdlg, TBID, %WM_SIZE, 0, 0
      FUNCTION= 1
    END FUNCTION
    
    
    CALLBACK FUNCTION maincb
      STATIC fname$,filter$,d&
    
      SELECT CASE CBMSG
          CASE %WM_COMMAND
              SELECT CASE CBCTL
                  CASE= %IDOK
                      DIALOG END CBHNDL
    
                  CASE %IDC_BUTTON1 TO %IDC_BUTTON9
                      'filter$ = "All Files (*.*)" & "|" & "*.*"
                      'd& = OPENFILEDIALOG(CBHNDL,"Choose a File", fname$, CURDIR$, filter$,"*.*",0)
                      SELECT CASE CBCTL
                        CASE %IDC_BUTTON1
                            MSGBOX("1")
                        CASE %IDC_BUTTON2
                            MSGBOX("2")
                        CASE %IDC_BUTTON3
                            MSGBOX("3")
                        CASE %IDC_BUTTON4
                            MSGBOX("4")
                        CASE %IDC_BUTTON5
                            MSGBOX("5")
                        CASE %IDC_BUTTON6
                            MSGBOX("6")
                        CASE %IDC_BUTTON7
                            MSGBOX("7")
                        CASE %IDC_BUTTON8
                            MSGBOX("8")
                        CASE %IDC_BUTTON9
                            MSGBOX("9")
                      END SELECT
              END SELECT
      END SELECT
    END FUNCTION
    
    FUNCTION PBMAIN
      DIM   hdlg AS LONG
      LOCAL Flag AS LONG
    
      'These flags set the type of toolbar to generate
      '0=Custom Buttons and text
      '1=Standard Buttons and text
      '2=Custom Buttons no text
      '3=Standard Buttons no text
      Flag = 3  '0 = %TB_LIST, 1 = %TB_STD_LIST, 2 = %TB_BM_ONLY, 3 = %TB_STD_BM
    
      'Button sizes were determined as the best fit for the default font.
      'If you change the font you will need to change those values.
    
      ghInstance = GetWindowLongA(hDlg, %GWL_HINSTANCE)
      hBmp = LoadImageA(ghInstance, "#125", %IMAGE_BITMAP, 0,0, %LR_LOADTRANSPARENT OR %LR_LOADMAP3DCOLORS)
    
      DIALOG NEW 0,"Separate Toolbar Buttons",0,0,400,120,%DS_MODALFRAME OR %DS_3DLOOK OR %DS_CENTER OR %WS_POPUP OR %WS_CAPTION,, TO hDlg
      CONTROL ADD BUTTON,hDlg,%IDOK,"OK",175,100,50,14,,,
      SELECT CASE Flag
          CASE 0
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR1, %IDC_BUTTON1, 0, "New",        2,5,39,24,%TB_LIST)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR2, %IDC_BUTTON2, 1, "Open",      41,5,41,24,%TB_LIST)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR3, %IDC_BUTTON3, 2, "Save",      82,5,40,24,%TB_LIST)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR4, %IDC_BUTTON4, 3, "Print",    122,5,39,24,%TB_LIST)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR5, %IDC_BUTTON5, 4, "Cut",      171,5,40,24,%TB_LIST)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR6, %IDC_BUTTON6, 5, "Copy",     211,5,40,24,%TB_LIST)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR7, %IDC_BUTTON7, 6, "Paste",    251,5,42,24,%TB_LIST)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR8, %IDC_BUTTON8, 7, "Find",     303,5,40,24,%TB_LIST)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR9, %IDC_BUTTON9, 8, "Replace",  343,5,50,24,%TB_LIST)
    
          CASE 1
              'Standard Button bitmap sequence
              '0=cut
              '1=copy
              '2=paste
              '3=undo
              '4=redo
              '5=delete
              '6=new
              '7=open
              '8=save
              '9=find
              '10=
              '11=help
              '12=find
              '13=find and replace
              '14=print
    
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR1, %IDC_BUTTON1,  6, "New",       2,5,33,16,%TB_STD_LIST)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR2, %IDC_BUTTON2,  7, "Open",     35,5,36,16,%TB_STD_LIST)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR3, %IDC_BUTTON3,  8, "Save",     72,5,35,16,%TB_STD_LIST)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR4, %IDC_BUTTON4, 14, "Print",   107,5,32,16,%TB_STD_LIST)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR5, %IDC_BUTTON5,  0, "Cut",     147,5,29,16,%TB_STD_LIST)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR6, %IDC_BUTTON6,  1, "Copy",    176,5,34,16,%TB_STD_LIST)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR7, %IDC_BUTTON7,  2, "Paste",   210,5,36,16,%TB_STD_LIST)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR8, %IDC_BUTTON8, 12, "Find",    254,5,31,16,%TB_STD_LIST)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR9, %IDC_BUTTON9, 13, "Replace", 285,5,45,16,%TB_STD_LIST)
    
          CASE 2
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR1, %IDC_BUTTON1,  0, "New",       2,5,24,24,%TB_BM_ONLY)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR2, %IDC_BUTTON2,  1, "Open",     26,5,24,24,%TB_BM_ONLY)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR3, %IDC_BUTTON3,  2, "Save",     50,5,24,24,%TB_BM_ONLY)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR4, %IDC_BUTTON4,  3, "Print",    74,5,24,24,%TB_BM_ONLY)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR5, %IDC_BUTTON5,  4, "Cut",     108,5,24,24,%TB_BM_ONLY)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR6, %IDC_BUTTON6,  5, "Copy",    132,5,24,24,%TB_BM_ONLY)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR7, %IDC_BUTTON7,  6, "Paste",   156,5,24,24,%TB_BM_ONLY)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR8, %IDC_BUTTON8,  7, "Find",    190,5,24,24,%TB_BM_ONLY)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR9, %IDC_BUTTON9,  8, "Replace", 214,5,24,24,%TB_BM_ONLY)
    
          CASE 3
              'Standard Button bitmap sequence
              '0=cut
              '1=copy
              '2=paste
              '3=undo
              '4=redo
              '5=delete
              '6=new
              '7=open
              '8=save
              '9=find
              '10=
              '11=help
              '12=find
              '13=find and replace
              '14=print
    
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR1, %IDC_BUTTON1,  6, "New",       2,5,16,16,%TB_STD_BM)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR2, %IDC_BUTTON2,  7, "Open",     18,5,16,16,%TB_STD_BM)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR3, %IDC_BUTTON3,  8, "Save",     34,5,16,16,%TB_STD_BM)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR4, %IDC_BUTTON4, 14, "Print",    50,5,16,16,%TB_STD_BM)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR5, %IDC_BUTTON5,  0, "Cut",      74,5,16,16,%TB_STD_BM)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR6, %IDC_BUTTON6,  1, "Copy",     90,5,16,16,%TB_STD_BM)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR7, %IDC_BUTTON7,  2, "Paste",   106,5,16,16,%TB_STD_BM)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR8, %IDC_BUTTON8, 12, "Find",    130,5,16,16,%TB_STD_BM)
              CALL CREATEFLATBUTTON(hdlg, %ID_TOOLBAR9, %IDC_BUTTON9, 13, "Replace", 146,5,16,16,%TB_STD_BM)
    
      END SELECT
      DIALOG SET COLOR hDlg,%BLACK,%CYAN
      DIALOG SHOW MODAL hDlg CALL MainCB
    END FUNCTION
    Last edited by Jim Fritts; 13 Aug 2020, 07:17 AM.

    Leave a comment:


  • BOB MECHLER
    replied
    Using the toolbar to make transparent graphical buttons

    I saw in Poffs this approach to using a toolbar as a transparent graphic button and liked the ease of used as opposed to subclassing to get the hover over raised and flat appearance if not over.

    This code came from a 2001 post by Jeffrey Radue which I adapted. I've shown the code to make the PBR file and used the toolbar.bmp everyone should already have. In my own code, we created a little nicer set of graphics but this does the trick to show their usage.

    Doing it this way would allow me to more easily create, hide different controls without disabling, enabling and placing if I created a toolbar control with all 5 items in one control.

    Also, I don't seem to need the WM_NOTIFY event to work with the control in this manner.

    There are several other options here which I didn't remove just to show other options that were there.

    Bob Mechler

    Code:
    'Modified from POFFS code by
    ''Jeffrey R. Radue
    ''posted January 05, 2001 06:09 PM
    
    'STANDARD.RC is below. Copy the next three lines to STANDARD.RC, remove the apostrophe's and compile in the PB compiler to get the .PBR
    
    
    ';TOOLBAR.BMP found in PBWIN70\SAMPLES\SDK\SKELETON
    '#define IDR_IMGFILE    104
    'IDR_IMGFILE  BITMAP DISCARDABLE "TOOLBAR.BMP"
    
    
    'Start of program code
    'I thought this approach gave a really nice graphical button with flat transparent appearance. When the mouse hovers over it, the button becomse raised.
    'Click each button to see WM_COMMAND reacting like any button would. 
    'So far I only have what I wanted which is the TB_LIST option.
    'Thanks to Jeff Radue and POFFS by Borge
    
    #COMPILE EXE "flatbut.exe"
    #REGISTER NONE
    #DIM ALL
    
    #RESOURCE "STANDARD.PBR"  
    
    
    
    
    
    $INCLUDE "win32api.inc"
    $INCLUDE "comdlg32.inc"
    $INCLUDE "Commctrl.inc"
    
    %ID_TOOLBAR   = 2033
    %ID_TOOLBAR2  = 2034
    %ID_TOOLBAR3  = 2035
    %ID_TOOLBAR4  = 2036
    %ID_TOOLBAR5  = 2037
    %TB_LIST      = 0
    %TB_STD_LIST  = 1
    %TB_BM_ONLY   = 2
    %TB_STD_BM    = 3
    %IDC_BUTTON1  = 100
    %IDC_BUTTON2  = 101
    %IDC_BUTTON3  = 102
    %IDC_BUTTON4  = 103
    %IDC_BUTTON5  = 104
    %ID_EDIT1     = 105
    %ID_EDIT2     = 106
    %ID_EDIT3     = 107
    %ID_EDIT4     = 108
    
    FUNCTION CreateFlatButton(BYVAL hdlg&,BYVAL TBID&,BYVAL ctl&,BYVAL resID&,txt$,BYVAL x&,BYVAL y&,BYVAL wdth&,BYVAL hgt&,BYVAL flag&) AS LONG
      LOCAL tb AS TBBUTTON
      LOCAL Tabm AS TBADDBITMAP
      Tb.iBitmap = resID&
      Tb.fsState = %TBSTATE_ENABLED
      Tb.fsStyle = %TBSTYLE_BUTTON
      Tb.dwData = 0
      Tb.iString = 0
      Tb.idCommand = ctl&
      SELECT CASE flag&
        CASE 0,1 'List Style, with text to the right
          CONTROL ADD "TOOLBARWINDOW32", hdlg&, TBID&, "",x&,y&,wdth&,hgt&+4, %WS_CHILD OR %WS_VISIBLE OR %CCS_NOPARENTALIGN OR %TBSTYLE_TOOLTIPS _
          OR %TBSTYLE_FLAT OR %CCS_NORESIZE OR %CCS_NODIVIDER OR %TBSTYLE_LIST
          IF (flag&= 0) THEN 'Uses DLL resource file for image
            Tabm.hInst = GetModuleHandle(BYVAL %NULL)
            'Tabm.nID = resID&
            Tabm.nID = 104  'refers to my multiple image toolbar bitmap mentioned above
            Tb.iBitmap = resID&
            ELSE ' Use standard system bitmaps
              Tabm.hInst = %HINST_COMMCTRL
              Tabm.nID = %IDB_STD_SMALL_COLOR
              Tb.iBitmap = resID&
          END IF
          CONTROL SEND hdlg&, TBID&,%TB_SETBITMAPSIZE,0,MAKLNG(hgt&,hgt&)
          CONTROL SEND hdlg&, TBID&, %TB_ADDBITMAP,1, VARPTR(Tabm)
          CONTROL SEND hdlg&, TBID&, %TB_BUTTONSTRUCTSIZE, SIZEOF(Tb), 0
          CONTROL SEND hdlg&, TBID&, %TB_ADDBUTTONS,1, VARPTR(Tb)
          txt$ = txt$ & $NUL & $NUL
          CONTROL SEND hdlg&, TBID&, %TB_ADDSTRING, 0, STRPTR(txt$)
        CASE ELSE ' No text, just a bitmap
          CONTROL ADD "TOOLBARWINDOW32", hdlg&, TBID&, "",x&,y&,wdth&,hgt&, %WS_CHILD OR %WS_VISIBLE OR %CCS_NOPARENTALIGN OR %TBSTYLE_TOOLTIPS _
          OR %TBSTYLE_FLAT OR %CCS_NORESIZE OR %CCS_NODIVIDER
          IF (flag&= 2) THEN 'Uses DLL resource file for image
            Tabm.hInst = GetModuleHandle(BYVAL %NULL)
            Tabm.nID = resID&
            ELSE ' Use standard system bitmaps
              Tabm.hInst = %HINST_COMMCTRL
              Tabm.nID = %IDB_STD_SMALL_COLOR
              Tb.iBitmap = resID&
          END IF
          CONTROL SEND hdlg&, TBID&,%TB_SETBITMAPSIZE,0,MAKLNG(hgt&,hgt&)
          CONTROL SEND hdlg&, TBID&, %TB_ADDBITMAP,1, VARPTR(Tabm)
          CONTROL SEND hdlg&, TBID&, %TB_BUTTONSTRUCTSIZE, SIZEOF(Tb), 0
          CONTROL SEND hdlg&, TBID&, %TB_ADDBUTTONS,1, VARPTR(Tb)
      END SELECT
      CONTROL SEND hdlg&, TBID&, %WM_SIZE, 0, 0
      FUNCTION= 1
    END FUNCTION
    
    
    CALLBACK FUNCTION maincb
      STATIC fname$,filter$,d&
      SELECT CASE CBMSG
        CASE %WM_COMMAND
          SELECT CASE CBCTL
            CASE= %IDOK
              DIALOG END CBHNDL
            CASE %IDC_BUTTON1 TO %IDC_BUTTON5
              'filter$ = "All Files (*.*)" & "|" & "*.*"
              'd& = OPENFILEDIALOG(CBHNDL,"Choose a File", fname$, CURDIR$, filter$,"*.*",0)
            SELECT CASE CBCTL
              CASE %IDC_BUTTON1 
                 MSGBOX("1")
              CASE %IDC_BUTTON2
                 MSGBOX("2")
              CASE %IDC_BUTTON3
                 MSGBOX("3")
               CASE %IDC_BUTTON4
                 MSGBOX("4")
              CASE %IDC_BUTTON5
                 MSGBOX("5")
            END SELECT
          END SELECT
      END SELECT
    END FUNCTION
    
    FUNCTION PBMAIN
      DIM hdlg AS LONG
      DIALOG NEW 0,"Separate Toolbar Buttons",0,0,400,120,%DS_MODALFRAME OR %DS_3DLOOK OR %DS_CENTER OR %WS_POPUP OR %WS_CAPTION,, TO hDlg
      CONTROL ADD BUTTON,hDlg,%IDOK,"OK",175,100,50,14,,,
      CALL CREATEFLATBUTTON(hdlg&,%ID_TOOLBAR,%IDC_BUTTON1,20,"Stop",20,5,56,24,%TB_LIST)
      CALL CREATEFLATBUTTON(hdlg&,%ID_TOOLBAR2,%IDC_BUTTON2,0,"Add",100,5,56,24,%TB_LIST)
      CALL CREATEFLATBUTTON(hdlg&,%ID_TOOLBAR3,%IDC_BUTTON3,11,"Change ",180,5,56,24,%TB_LIST)
      CALL CREATEFLATBUTTON(hdlg&,%ID_TOOLBAR4,%IDC_BUTTON4,16,"Delete ",260,5,56,24,%TB_LIST)
      CALL CREATEFLATBUTTON(hdlg&,%ID_TOOLBAR5,%IDC_BUTTON5,7,"Inquire ",340,5,56,24,%TB_LIST)
      DIALOG SET COLOR hDlg,%BLACK,%CYAN
      DIALOG SHOW MODAL hDlg CALL MainCB
    END FUNCTION
    Last edited by BOB MECHLER; 23 Aug 2009, 03:22 PM. Reason: More info

    Leave a comment:


  • Roger Garstang
    replied
    I would guess it used a layered window and set the alpha level. It would look ok as a layered toolwindow containing the toolbar. Unless he meant just the one below the regular menu which wouldn't do much for transparent being up there and not moving.

    Leave a comment:


  • Jeff Blakeney
    replied
    Just out of curiousity, why didn't you just leave your original question and add a reply with at least a link to what you found in MSDN? People browsing the forums with an interest in transparent toolbars will almost certainly take a look at this thread but now there is nothing in it.

    Leave a comment:


  • BOB MECHLER
    started a topic Transparent ToolBar?

    Transparent ToolBar?

    withdrawn. Found the answer in MSDN.

    Bob Mechler
    Last edited by BOB MECHLER; 22 Aug 2009, 08:05 PM.
Working...
X