Announcement

Collapse
No announcement yet.

9.02 messed up my toolbar

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

  • 9.02 messed up my toolbar

    Hi,
    maybe i have missed something, but my toolbar, which was fine in 9.01, is very wide in 9.02. All separators have the same width as the buttons it seems, no matter what value I give as SIZE parameter in the TOOLBAR ADD SEPARATOR command.
    Is this a bug? Or a change in default behaviour? Or am I missing something? (I could not find anything in the documentation.)
    Any hints, ideas, how to rectify this? Thanks!

  • #2
    Originally posted by Christian Grimsel View Post
    Hi,

    Any hints, ideas, how to rectify this? Thanks!
    Sure, Post offending code, or compileable example.

    =========================================
    "Your Highness,
    I have no need of this hypothesis."
    Pierre Laplace (1749-1827), to Napoleon
    on why his works on celestial mechanics
    make no mention of God.
    =========================================
    It's a pretty day. I hope you enjoy it.

    Gösta

    JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
    LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

    Comment


    • #3
      Gösta,
      your answer suggests, that it is not a common problem ?

      Well, these are the lines, which worked fine in 9.01:

      '------------------------------------------------------------------------------
      ' Add Toolbar to dialog
      '------------------------------------------------------------------------------

      IMAGELIST NEW BITMAP 20, 20, 32, 23 TO hImageList

      IMAGELIST ADD BITMAP hImageList, "TOOLBAR"


      CONTROL ADD TOOLBAR, hMain, %TLB_FRM_QVEL, "", 1, 1, 0, 0, _
      %WS_CHILD OR %WS_VISIBLE OR %CCS_TOP OR _
      %TBSTYLE_FLAT OR %TBSTYLE_TOOLTIPS OR %CCS_NODIVIDER, _
      0

      TOOLBAR SET IMAGELIST hMain, %TLB_FRM_QVEL, hImageList, 0

      TOOLBAR ADD BUTTON hMain, %TLB_FRM_QVEL, %BMP_TLB_MARKER, %BTN_TLB_MARKER, %TBSTYLE_BUTTON, ""
      TOOLBAR ADD BUTTON hMain, %TLB_FRM_QVEL, %BMP_TLB_DBMGR, %BTN_TLB_DBMGR, %TBSTYLE_BUTTON, ""
      TOOLBAR ADD SEPARATOR hMain, %TLB_FRM_QVEL, 1
      TOOLBAR ADD BUTTON hMain, %TLB_FRM_QVEL, %BMP_TLB_PROJ_OPEN, %BTN_TLB_PROJ_OPEN, %TBSTYLE_BUTTON, ""
      TOOLBAR ADD BUTTON hMain, %TLB_FRM_QVEL, %BMP_TLB_PROJ_PSEUDO, %BTN_TLB_PROJ_PSEUDO, %TBSTYLE_BUTTON, ""
      TOOLBAR ADD BUTTON hMain, %TLB_FRM_QVEL, %BMP_TLB_PROJ_SELWIN, %BTN_TLB_PROJ_SELWIN, %TBSTYLE_BUTTON, ""
      TOOLBAR ADD BUTTON hMain, %TLB_FRM_QVEL, %BMP_TLB_PROJ_SELWELL, %BTN_TLB_PROJ_SELWELL, %TBSTYLE_BUTTON, ""
      TOOLBAR ADD SEPARATOR hMain, %TLB_FRM_QVEL, 1

      a.s.o

      Christian

      Comment


      • #4
        Right after I got version 9 of PBWin I wrote a small program to learn to use the toolbar control and I had the same problem, as I recall it. The seperators were the same width as the icons or else they were a lot wider than I wanted them to be; I don't recall which. I do remember became unusably wide.

        I don't still have the code, unfortunately.

        Barry

        Comment


        • #5
          Originally posted by Christian Grimsel View Post
          Gösta,
          your answer suggests, that it is not a common problem ?
          9.02 has only been out a few days so there really is no way to know if it's a common problem, or even a problem at all.
          Well, these are the lines, which worked fine in 9.01:
          I, for one, would be unable to test them for you. That's why compileable examples are best to post. Guys can then just C&P them into an editor and (try to) run them.

          Another tip, enclose your code examples with code tags [ c o d e ] ... [ / c o d e ] (no spaces). Easier to read and run.

          =====================================
          "You got to be careful
          if you don't know where you're going,
          because you might not get there."
          Yogi Berra
          =====================================
          It's a pretty day. I hope you enjoy it.

          Gösta

          JWAM: (Quit Smoking): http://www.SwedesDock.com/smoking
          LDN - A Miracle Drug: http://www.SwedesDock.com/LDN/

          Comment


          • #6
            I just tested this, and get the same results.

            For those needing to test this, just use the default toolbar example included with PB 9.02 and simply add a separator between the buttons.

            The history file says they made some changes to the separator which would explain why it works fine in 9.01. It appears the changes knackered something by mistake.
            Last edited by Brice Manuel; 12 Oct 2009, 08:49 AM. Reason: clarity

            Comment


            • #7
              So maybe somebody from Powerbasic could comment on this ?

              And - is there a work around ? Can you actually resize the separators after they have been created ?

              Christian

              Comment


              • #8
                Christian, rather than reverting back to 9.01, I have reworked my toolbar images to make the separator a part of the image. It is NOT a good solution, but the only solution I have been able to come up with for now.

                Comment


                • #9
                  It is NOT a good solution, but the only solution I have been able to come up with for now.
                  It's not a solution. It's a workaround.
                  Michael Mattias
                  Tal Systems (retired)
                  Port Washington WI USA
                  [email protected]
                  http://www.talsystems.com

                  Comment


                  • #10
                    Well, for the time being, I will comment out all SEPARATOR lines. It's not a solution either, but it is the easiest to be able to continue developing until a real solution or work-around becomes available.
                    Christian

                    Comment


                    • #11
                      Don't care to name this as a workaround or a solution but here's 'something' that seems to work..
                      Code:
                        Local TBB As TBBUTTON
                        TBB.fsStyle    = %TBSTYLE_SEP
                        TBB.iBitmap    = 8 ' choose size here
                        Control Send hDlg, %ID_TOOLBAR, %TB_INSERTBUTTON, 1, Varptr(TBB)  ' Sep pos zero based
                      Tested by insertion just after
                      Code:
                        TOOLBAR ADD BUTTON    hDlg, %ID_TOOLBAR, 3, %ID_BTN_PROP,  %TBSTYLE_BUTTON, "Properties"
                      In PB's Toolbar.bas sample code.
                      Rgds, Dave

                      Comment


                      • #12
                        Dave,

                        thanks a lot ! It works perfectly. Actually, it seems, you do not need the .iBitMap value. WinAPI says "Zero-based index of button image." (It is easy to look something up once somebody else told you, what to look for).
                        So these are the lines I added (the original TOOLBAR ADD SEPARATOR commands are left in as comments - just in case...):

                        Code:
                           LOCAL TBB        AS TBButton
                        ...
                        other code
                        ...
                        '------------------------------------------------------------------------------
                        ' Add Toolbar to dialog
                        '------------------------------------------------------------------------------
                        
                           IMAGELIST NEW BITMAP  20, 20, 32, 23 TO hImageList
                        
                           IMAGELIST ADD BITMAP  hImageList, "TOOLBAR"
                        
                           TBB.fsStyle    = %TBSTYLE_SEP
                        
                           CONTROL ADD TOOLBAR,  hMain, %TLB_FRM_QVEL, "", 1, 1, 0, 0, _
                                                 %WS_CHILD     OR %WS_VISIBLE       OR %CCS_TOP       OR _
                                                 %TBSTYLE_FLAT OR %TBSTYLE_TOOLTIPS OR %CCS_NODIVIDER, _
                                                 0
                        
                           TOOLBAR SET IMAGELIST hMain, %TLB_FRM_QVEL, hImageList, 0
                        
                           TOOLBAR ADD BUTTON    hMain, %TLB_FRM_QVEL, %BMP_TLB_MARKER,       %BTN_TLB_MARKER,       %TBSTYLE_BUTTON, ""
                           TOOLBAR ADD BUTTON    hMain, %TLB_FRM_QVEL, %BMP_TLB_DBMGR,        %BTN_TLB_DBMGR,        %TBSTYLE_BUTTON, ""
                           CONTROL SEND          hMain, %TLB_FRM_QVEL, %TB_INSERTBUTTON, 2, VARPTR(TBB)
                        
                        '   TOOLBAR ADD SEPARATOR hMain, %TLB_FRM_QVEL, 1
                        
                           TOOLBAR ADD BUTTON    hMain, %TLB_FRM_QVEL, %BMP_TLB_PROJ_OPEN,    %BTN_TLB_PROJ_OPEN,    %TBSTYLE_BUTTON, ""
                           TOOLBAR ADD BUTTON    hMain, %TLB_FRM_QVEL, %BMP_TLB_PROJ_PSEUDO,  %BTN_TLB_PROJ_PSEUDO,  %TBSTYLE_BUTTON, ""
                           TOOLBAR ADD BUTTON    hMain, %TLB_FRM_QVEL, %BMP_TLB_PROJ_SELWIN,  %BTN_TLB_PROJ_SELWIN,  %TBSTYLE_BUTTON, ""
                           TOOLBAR ADD BUTTON    hMain, %TLB_FRM_QVEL, %BMP_TLB_PROJ_SELWELL, %BTN_TLB_PROJ_SELWELL, %TBSTYLE_BUTTON, ""
                           CONTROL SEND          hMain, %TLB_FRM_QVEL, %TB_INSERTBUTTON, 7, VARPTR(TBB)
                        
                        '   TOOLBAR ADD SEPARATOR hMain, %TLB_FRM_QVEL, 1
                        
                           TOOLBAR ADD BUTTON    hMain, %TLB_FRM_QVEL, %BMP_TLB_FORMATION,    %BTN_TLB_INT_DEFINE,   %TBSTYLE_BUTTON, ""
                           TOOLBAR ADD BUTTON    hMain, %TLB_FRM_QVEL, %BMP_TLB_WELL_ONOFF,   %BTN_TLB_INT_WELLS,    %TBSTYLE_BUTTON, ""
                           TOOLBAR ADD BUTTON    hMain, %TLB_FRM_QVEL, %BMP_TLB_FRM_RESULT,   %BTN_TLB_INT_DISPL,    %TBSTYLE_BUTTON, ""
                           CONTROL SEND          hMain, %TLB_FRM_QVEL, %TB_INSERTBUTTON, 11, VARPTR(TBB)
                        
                        '   TOOLBAR ADD SEPARATOR hMain, %TLB_FRM_QVEL, 1
                        
                           TOOLBAR ADD BUTTON    hMain, %TLB_FRM_QVEL, %BMP_TLB_VELOC,        %BTN_TLB_FUNCTION,     %TBSTYLE_BUTTON, ""
                           CONTROL SEND          hMain, %TLB_FRM_QVEL, %TB_INSERTBUTTON, 13, VARPTR(TBB)
                        
                        '   TOOLBAR ADD SEPARATOR hMain, %TLB_FRM_QVEL, 1
                        
                        ... a.s.o

                        Thanks again

                        Christian

                        Comment


                        • #13
                          > WinAPI says "Zero-based index of button image.

                          One word of caution..... while Windows uses zero-based indexing, all the 'native' DDT commands use one-based indexing.

                          e.g

                          CONTROL SEND needs to use the Windows indexing. (command used directly by Windows)
                          LISTBOX SELECT needs to use PB/DDT indexing (command used by DDT engine)

                          MCM
                          *Pending implementation of my NFS to add an ....
                          Code:
                          #OPTION BASE DDT 0|1    ' default 1 which is what it is now
                          .. compiler directive
                          Michael Mattias
                          Tal Systems (retired)
                          Port Washington WI USA
                          [email protected]
                          http://www.talsystems.com

                          Comment


                          • #14
                            Christian,

                            Glad to help.

                            You can use the .iBitmap member to set the width of the separator - it defaults to 8 pixels if the member is not specified.

                            BTW if you didn't have Win32API.inc and CommCtrl.inc at the top of your code you would need to add declares for the TBBUTTON Type and the %TB_INSERTBUTTON equate there as they are not currently 'Built-In' to PBWin902.
                            Code:
                             '#INCLUDE "Win32API.inc"  ' OR..
                             TYPE TBBUTTON
                              iBitmap AS LONG
                              idCommand AS LONG
                              fsState AS BYTE
                              fsStyle AS BYTE
                              bReserved(0 TO 1) AS BYTE
                              dwData AS DWORD
                              iString AS LONG
                            END Type
                             
                             '#INCLUDE "CommCtrl.inc"  ' OR..
                            %TB_INSERTBUTTON  = %WM_USER + 21
                            Last edited by Dave Biggs; 14 Oct 2009, 12:57 PM. Reason: sp
                            Rgds, Dave

                            Comment


                            • #15
                              Thank you Dave. You da man!

                              Comment

                              Working...
                              X