Announcement

Collapse
No announcement yet.

ButtonPlus in Source Code

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

  • Barry Erick
    replied
    New problem. One column in a listview won't come through when i use the DDT LISTVIEW GET TEXT hndl, id, 1,6 to stxt. All the other columns work, all are TEXT columns and this column has a file location in it: "C:\folder\subfolder\filename.ext" in it and is the only column that goes though button plus when I trace it. The stxt is empty when Button Plus is done. I don't know whey this column goes through button plus when the others do not. I do not set color of this column different than others at all.

    Leave a comment:


  • Barry Erick
    replied
    Originally posted by Michael Mattias View Post
    What you describe is the "valid" situation.

    I am thinking of all the times I see "CONTROL anything CBHNDL..." on a window/control NOT created by DDT (or created with CONTROL ADD "classname").

    Those calls may 'work'; they may not. They may even work today but not tomorrow.

    MCM
    CBHNDL is not valid outside of a DDT Callback, those are called by passing cb.hndl to the function from the callback and using CONTROL hdnl,iid to access the control. Or, your favorite, GLOBAL MainHndl as dword, then pass the handle from the main dialog or in the init section of it's callback. The DDT controls can be used anywhere IF the handle is passed. And not by CBHDNL or its replacement, CB.HNDL.

    Leave a comment:


  • Michael Mattias
    replied
    What you describe is the "valid" situation.

    I am thinking of all the times I see "CONTROL anything CBHNDL..." on a window/control NOT created by DDT (or created with CONTROL ADD "classname").

    Those calls may 'work'; they may not. They may even work today but not tomorrow.

    MCM

    Leave a comment:


  • Barry Erick
    replied
    Originally posted by Michael Mattias View Post
    >Try it [before] you cay it can't be done

    I'm not saying things "can't be done" in the sense they might "work today;" I am saying they are not supported, and if they stop "working" in the next release of either the operating system or compiler, be neither surprised, disappointed or whiney.

    MCM
    AS long as CONTROL HANDLE cb.hndl,%IDD to winhndl remains the same, it will work. Even with LISTVIEW, you can get the handle and use API's listview items. I place the sort arrow in the column header using sdk on the PB Listview. The worst that will happen is the Listview would have to be done in SDK and even the current PBForms uses some SDK to draw with as PB did not have the stuff when it was written and I use PB commands within those. They have worked since back in PB/DLL days.

    Leave a comment:


  • Michael Mattias
    replied
    >Try it [before] you cay it can't be done

    I'm not saying things "can't be done" in the sense they might "work today;" I am saying they are not supported, and if they stop "working" in the next release of either the operating system or compiler, be neither surprised, disappointed or whiney.

    MCM

    Leave a comment:


  • Laurence Jackson
    replied
    So problem solved then Barry? (hope so, because I don't really understand what was happening!).

    ButtonPlus is most definitely designed to work with DDT since I myself only resort to the API when I have to. I must admit that I haven't yet had occasion to use BP with PB10 though.

    Leave a comment:


  • Barry Erick
    replied
    The problem was I was saving the value of the text box as -2 instead of -1 for system.

    ANd you can mix DDT with other things and button plus uses sdk, which I have mixed with DDT for years. The CONTROL HANDLE allows pointing to the item for the sdk. And Button plus is designed to be used with DDT buttons. Since you do not use DDT, you can't see the weird thing by seeting a text background to -2 and passing your mosue over it.

    Anyway, it is working fine mixing DDT with sdk. And you can use sdk mixed with DDT controls if there is not a compatible ddt thing. I sid that for listview sort numeric back when 10.00 came out and it's DDT did not work. And originally used the sdk for listview stuff before PB had it. And I still mix progress bar ddt with progressbar sdk.

    Try it beofre you cay it can't be done.

    Leave a comment:


  • Michael Mattias
    replied
    >and mixing buttonPlus with Control set color

    Does Button Plus create DDT-managed controls? If not, there's your problem: CONTROL SET COLOR was designed for use with DDT-managed controls.

    Besides, even CONTROL SET COLOR is not meant for buttons:

    Restrictions
    Windows does not permit the color of standard push button controls, line controls, image controls, image buttons, and most common controls to be altered by the standard CONTROL SET COLOR techniques.
    - Source: PB/Win 9.0.5 help

    Leave a comment:


  • Barry Erick
    replied
    I have a weird problem when using this with PBWin10 and mixing buttonPlus with Control set color for lables and textboxes. A non-colorized or touched by code in ButtonPlus calls or Control Set Color end up in some textboxes when ButtonPlus is being used during WM_INITDIALOG or moving the mouse over a text box. Have you ever seen this? I do not have any weird ID's duplicate or do I set the checkbox twice. ANd if I do not colorize one text, with control set color , the problme will move to the next textbox.

    I will try to bring this down to a small example and post it.

    Leave a comment:


  • Gösta H. Lovgren-2
    replied
    LJ, I think there may be a problem in BP. I was playing around with Scott Slater's Butons in Listbox (neat idea) - http://www.powerbasic.com/support/pb...ad.php?t=40672 -

    And when I added BP, trying to scroll (see thread above) I would get a bunch of Error 9's. It didn't happen with Chris' code so that's what I posted there.

    The E9's went away when I commented out the %WM_VScroll in scott's first version.

    Code:
    'http://www.powerbasic.com/support/pbforums/showthread.php?t=40672
    'scott Slater
    #Compile Exe
    #Dim All
    #Optimize SPEED  'Fly baby Fly!!!
    #Debug Display On '<<<<<<<<<<<<<<< Remember to turn off for production code
     
    #Include "win32api.inc"
     'these next included files needed for button colors can be found here: 
     'http://www.powerbasic.com/support/pbforums/showthread.php?t=38904
    #Include "C:\Only_My_Programs\Include Files\ButtonPlus.bas"
    '#Resource "C:\Only_My_Programs\Include Files\ButtonPlusDemo.pbr"
    
     
    Global gOldLBProc As Dword
    '
    ' *******************************************************
    '
    Function  Btn_Set_Face_Color(ddlg As Dword, Id As Long, Btn_Color As Long) As Long
      ButtonPlus  ddlg, Id, %BP_FACE_BLEND, 255 'true color
       ButtonPlus dDlg, Id, %BP_FACE_COLOR, Btn_Color ' &H008FDF8F 
    End Function 
    '
    Function  Btn_Set_Text_Color(ddlg As Dword, Id As Long, Btn_Color As Long) As Long
       ButtonPlus dDlg, Id, %BP_Text_COLOR, Btn_Color ' &H008FDF8F 
    End Function 
    '
    ' *******************************************************
    '
    Function BtnLBproc(ByVal hWnd As Long, ByVal wMsg As Long, _
                           ByVal wParam As Long, ByVal lParam As Long) As Long
      Local rc As RECT
     
      Select Case wMsg
     
          Case %WM_Command
             If wParam > 200 Then 'Button ids
                GetClientRect hWnd, rc
    '
    ' *******************************************************
    '
                Btn_Set_Face_Color(hwnd, Wparam, %Black + 1)
                Btn_Set_Text_Color(hwnd, Wparam, %Yellow)
                Control ReDraw hwnd, Wparam
    '            MessageBox hWnd, "Button " & Format$(wParam - 200) & " clicked", "Button Click", 0
    '
    ' *******************************************************
    '
             End If
          Case %WM_SETFONT   ' Don't accept font messages for this control
             Exit Function
          Case %WM_DrawItem  ' Redraw entire listbox area
             GetClientRect hWnd, rc
             InvalidateRect hWnd, rc, 1
          Case %WM_VScroll   ' Redraw after scrolling
             SendMessage hWnd, %WM_DrawItem, wParam, lParam
     '<<<<<<< crashes here - Error 9's with SendMessage
     '>>>>>>>>> Scrolls fine without but only scroll 10 buttons, not all 25
      End Select
      Function = CallWindowProc(gOldLBProc, hWnd, wMsg, wParam, lParam) 'process other messages
     
    End Function
     
    CallBack Function MainDlgProc
     
       Select Case CB.Msg
          Case %WM_Destroy
             SetWindowLong GetDlgItem(CB.Hndl,100), %GWL_WNDPROC, gOldLBProc   ' unhook: restore original callback
          Case %WM_Command
             Select Case CB.Ctl
                Case %IdCancel
                   Dialog End CbHndl
             End Select
       End Select
       
    End Function
     
    Function PBMain () As Long
     
       Local hDlg, hLst, hFnt, BtnID, YPos As Long
       Local n, Btn_Face_Color, Btn_Text_Color As Long
       
       Font New "Ariel", 10 To hFnt
     
       Dialog New 0, "Test Button List",,, 100, 140 To hDlg
     
       Control Add ListBox, hDlg, 100, , 10, 10, 75, 115, %WS_Child Or %LBS_NoSel Or _
          %WS_TabStop Or %LBS_DisableNoScroll Or %WS_VScroll, %WS_Ex_ClientEdge  ' use %LBS_NOSEL to prevent selecting "text area"
          
       Control Set Font hDlg, 100, hFnt                   ' set the font, so that the height is the will contain the added buttons; should use FontIndirect
       Control Handle hDlg, 100 To hLst                   ' listbox handle for hook
       gOldLBProc = GetWindowLong(hLst, %GWL_WNDPROC)     ' save original LB Callback
       SetWindowLong hLst, %GWL_WNDPROC, CodePtr(BtnLBproc) ' assign our Callback so we can intercept messages.
     
       ' add some buttons to the listbox area: parent dialog for buttons is hLst
       YPos = 2
       For BtnID = 201 To 225
          Control Add Button, hLst, BtnID, "Button " & Format$(BtnID-200), 5, YPos, 80, 28
    '
    ' *******************************************************
    '
          'set button colors
          Incr n
          If n > 3 Then n = 1
          Select Case n      
            Case 1
              Btn_Face_Color = %Red
              Btn_Text_Color = %White
            Case 2
              Btn_Face_Color = %White
              Btn_Text_Color = %Blue
            Case 3
              Btn_Face_Color = %Blue
              Btn_Text_Color = %White
          End Select  
    '          Btn_Face_Color = %Red
    '          Btn_Text_Color = %White
             Btn_Set_Face_Color(Hlst, BtnId, Btn_Face_Color)
             Btn_Set_Text_Color(Hlst, BtnId, Btn_Text_Color)
            
          ListBox Add hDlg, 100, " "
          YPos += 32
       Next BtnID
    '
    ' *******************************************************
    '
     
       Control Add Button, hDlg, %IdCancel, "Close", 25, 117, 50, 20
     
       Dialog Show Modal hDlg Call MainDlgProc
     
       Font End hFnt
     
    End Function
    The E9 may not be in your code, LJ but I thought I'd mention it in case it was.

    ==================================================
    Certainly virtue is like precious odors,
    most fragrant when they are incensed, or crushed:
    for prosperity doth best discover vice,
    but adversity doth best discover virtue.
    Sir Francis Bacon
    ==================================================

    Leave a comment:


  • Laurence Jackson
    replied
    "Complaining" was just a poor choice of words, sorry! In your original example, I DID see the white spot when the button was pressed, but it was partially off the top of the button. Because it was a small vertical ellipse, it looked a bit wierd, but it was there.

    Leave a comment:


  • Gösta H. Lovgren-2
    replied
    Originally posted by Laurence Jackson View Post
    "...couldn't get it to work..." How did it fail? Your code seems to be working to me, so I need a bit more.
    What I mean(t) is the spot never showed up, I was looking for it to show up afterr a button was clicked in the example.
    If you are complaining about the spot sliding off the top of the button, that's by design to allow effects other than a circular or elliptical blob of color. The rules are not fully explained in the doc - sorry about that. Basically, if you want the whole spot on the button face, specify a smaller size and avoid TOP or BOTTOM.
    The smaller size did the trick. I changed
    Code:
      ButtonPlus hDlg, Id, %BP_SPOT_WIDTH, 8'16
      ButtonPlus hDlg, Id, %BP_SPOT_HEIGHT, 10'20
    and it showed up fine. For the record I am not "complaining". Merely trying to get it to work for me. (At least I hope it doesn't appear as "complaining.) BP is very neat code and I would expect it to become widely adopted by the PB community.

    Updated:
    http://www.swedesdock.com/powerbasic/Btn_Demo_using_Arrays.exe


    (Note for some reason editor won't allow entire link here. You'll have to C&P it into your browser or use the one in a prv msg)

    Thx again.
    Last edited by Gösta H. Lovgren-2; 1 Jun 2009, 08:51 PM.

    Leave a comment:


  • Laurence Jackson
    replied
    "...couldn't get it to work..." How did it fail? Your code seems to be working to me, so I need a bit more. If you are complaining about the spot sliding off the top of the button, that's by design to allow effects other than a circular or elliptical blob of color. The rules are not fully explained in the doc - sorry about that. Basically, if you want the whole spot on the button face, specify a smaller size and avoid TOP or BOTTOM.

    Yes, you're right. In the doc:

    ButtonPlus hDlg, %IDC_BUTTON, %BP_SPOT_POS, %TOP + %LEFT

    should be changed to:

    ButtonPlus hDlg, %IDC_BUTTON, %BP_SPOT_POS, %BS_TOP + %BS_LEFT

    Leave a comment:


  • Gösta H. Lovgren-2
    replied
    Laurence, I fooled with the Spot stuff tonight but just couldn't get it to work {sigh}. Here's the code I tried (note correction needed in docs). The full code is attached.
    Code:
    '
    Macro Btn_Spot
      ButtonPlus hDlg, Id, %BP_SPOT_COLOR, %White '%Red
      ButtonPlus hDlg, Id, %BP_SPOT_BLEND, &HFF
      ButtonPlus hDlg, Id, %BP_SPOT_WIDTH, 16
      ButtonPlus hDlg, Id, %BP_SPOT_HEIGHT, 20
      ButtonPlus hDlg, Id, %BP_SPOT_POS, %BS_TOP + %BS_Left '<-- incorrect in docs - no BP_ for Top or Left 
    End Macro
    '

    Here's a link to the exe http://www.swedesdock.com/powerbasic...ing_Arrays.exe


    {Note I also colored the buttons in the Unicode example. Took all of five minutes to do. And most of them were consumed in testing artistic color choices. {grin}))


    ===========================================================
    "The reasonable man adapts to the world:
    The unreasonable man persists
    in trying to adapt the world to himself.
    Therefore, all progress depends upon the unreasonable man."
    -- George Bernard Shaw
    ===========================================================
    Attached Files
    Last edited by Gösta H. Lovgren-2; 31 May 2009, 10:20 PM. Reason: Executions, Execitement, exefun, ...

    Leave a comment:


  • Gösta H. Lovgren-2
    replied
    Originally posted by Laurence Jackson View Post
    Buttons face colors have a default 50% transparency basically for the same reason as Windows normally colors buttons some shade of gray and not black or white. I'll quote myself:

    "First, primary colors on button faces tends to be a bit overpowering and gaudy. Second, when using XP-themed buttons, some degree of transparency is necessary to retain the proper effect of the buttons being pressed."
    My point is making subjective decisions -"a bit overpowering and gaudy." - that should be left to the programmer. Some us just may be gaudy, you know.

    As I said in the source code, José Roca really deserves the credit for much of what is in there. All I really did is package it up (I do take credit for "the spot" though!).
    Okay, I see now. It's really Jose's fault {grin}. Haven't tried the BP "spot" yet though I will. Must admit I haven't always been successful in finding the "spot' in other areas of endeavor though. Hopefully finding BP's spot will be as much fun looking. {llaugh}

    Again, thx for BP, LJ.

    ======================
    Different values make
    for a richer world.
    Unknown
    ======================
    Last edited by Gösta H. Lovgren-2; 31 May 2009, 09:34 PM. Reason: Wanted to be spot on

    Leave a comment:


  • Laurence Jackson
    replied
    Buttons face colors have a default 50% transparency basically for the same reason as Windows normally colors buttons some shade of gray and not black or white. I'll quote myself:

    "First, primary colors on button faces tends to be a bit overpowering and gaudy. Second, when using XP-themed buttons, some degree of transparency is necessary to retain the proper effect of the buttons being pressed."

    As I said in the source code, José Roca really deserves the credit for much of what is in there. All I really did is package it up (I do take credit for "the spot" though!).

    Leave a comment:


  • Gösta H. Lovgren-2
    replied
    Originally posted by Laurence Jackson View Post
    ...The other colors are not wrong, just subdued (alpha-blended with the underlying face color).
    Not quarreling or trying to be picky, LJ, but I am curious as to why you would "subdue' colors as a default. I would have thought (and did) you would render them as true as possible and have the "subdue" as an option. It just doesn't seem logical to me.

    Again I love ButtonPlus and am not criticizing (well maybe just a tad). It's so good I wouldn't be surprised to see some form of it be a part of PBWin10.

    ============================================
    People will not remember
    what you did or what you said.
    People will remember how you made them feel.
    LadyHawke
    ============================================

    Leave a comment:


  • Gösta H. Lovgren-2
    replied
    Originally posted by Laurence Jackson View Post
    ...
    The other colors are not wrong, just subdued (alpha-blended with the underlying face color). Check out the %BP_FACE_BLEND parameter. If you want a solid face color, pass a %BP_FACE_BLEND value of 255. The default is 128, as explained in the text file.
    RTFM, huh? Jeez, who'da thought? {just kidding} Did the trick L. I *love* ButtonPlus. Button coloring has long been yearned for in this pilothouse.

    If any are interested, here's some BP macros I just put together:
    Code:
     
    'Corrected Bp_Face_Black macro May 31
    '
    '************************  
    '    Global bp_Hndl As Dword 'used for button coloring
    '    Global bp_ctl  As Long 'used for button coloring
     
    Macro Bp_face_Black =  Bp_No_Blend: ButtonPlus bp_Hndl, bp_ctl, %BP_FACE_COLOR, %Black + 1 '   
    Macro Bp_face_Blue =   Bp_No_Blend: ButtonPlus bp_Hndl, bp_ctl, %BP_FACE_COLOR, %Blue
    Macro Bp_face_Green =  Bp_No_Blend: ButtonPlus bp_Hndl, bp_ctl, %BP_FACE_COLOR, %Green
    Macro Bp_face_Cyan =   Bp_No_Blend: ButtonPlus bp_Hndl, bp_ctl, %BP_FACE_COLOR, %Cyan
    Macro Bp_face_Red =    Bp_No_Blend: ButtonPlus bp_Hndl, bp_ctl, %BP_FACE_COLOR, %Red      
    Macro Bp_face_Magenta = Bp_No_Blend: ButtonPlus bp_Hndl, bp_ctl, %BP_FACE_COLOR, %Magenta
    Macro Bp_face_Yellow = Bp_No_Blend: ButtonPlus bp_Hndl, bp_ctl, %BP_FACE_COLOR, %Yellow
    Macro Bp_face_White =  Bp_No_Blend: ButtonPlus bp_Hndl, bp_ctl, %BP_FACE_COLOR, %White
    Macro Bp_face_Gray =   Bp_No_Blend: ButtonPlus bp_Hndl, bp_ctl, %BP_FACE_COLOR, %Gray
    Macro Bp_face_LtGray = Bp_No_Blend: ButtonPlus bp_Hndl, bp_ctl, %BP_FACE_COLOR, %LtGray
    '
    Macro Bp_text_Black =  ButtonPlus bp_Hndl, bp_ctl, %BP_text_COLOR, %Black    
    Macro Bp_text_Blue =   ButtonPlus bp_Hndl, bp_ctl, %BP_text_COLOR, %Blue
    Macro Bp_text_Green =  ButtonPlus bp_Hndl, bp_ctl, %BP_text_COLOR, %Green
    Macro Bp_text_Cyan =   ButtonPlus bp_Hndl, bp_ctl, %BP_text_COLOR, %Cyan
    Macro Bp_text_Red =    ButtonPlus bp_Hndl, bp_ctl, %BP_text_COLOR, %Red      
    Macro Bp_text_Magenta = ButtonPlus bp_Hndl, bp_ctl, %BP_text_COLOR, %Magenta
    Macro Bp_text_Yellow = ButtonPlus bp_Hndl, bp_ctl, %BP_text_COLOR, %Yellow
    Macro Bp_text_White =  ButtonPlus bp_Hndl, bp_ctl, %BP_text_COLOR, %White
    Macro Bp_text_Gray =   ButtonPlus bp_Hndl, bp_ctl, %BP_text_COLOR, %Gray
    Macro Bp_text_LtGray = ButtonPlus bp_Hndl, bp_ctl, %BP_text_COLOR, %LtGray
    Macro Bp_text_Color =  ButtonPlus bp_Hndl, bp_ctl, %BP_text_COLOR, Clor
    Macro Bp_No_Blend = ButtonPlus  bp_Hndl, bp_ctl, %BP_FACE_BLEND, 255 '1-255 transparency '255=true color
    '
    ' *******************************************************
    '
    ======================================
    High thoughts must have high language.
    Aristophanes
    ======================================
    Last edited by Gösta H. Lovgren-2; 31 May 2009, 09:33 PM. Reason: Corrected BP_Face_Black

    Leave a comment:


  • Laurence Jackson
    replied
    %BLACK has a value of zero, which is being interpreted by ButtonPlus as "use or revert to the default". So, you have to use 1 or RGB(1,1,1) if you want black (or very close to it).

    The other colors are not wrong, just subdued (alpha-blended with the underlying face color). Check out the %BP_FACE_BLEND parameter. If you want a solid face color, pass a %BP_FACE_BLEND value of 255. The default is 128, as explained in the text file.

    Leave a comment:


  • Gösta H. Lovgren-2
    replied
    JFF, I was playing around with button coloring this evening and came across an interesting phenomenon: The colors in ButtonPlus don't exactly translate; ie Red is Orange, Black is White, ... See sample:

    '
    Code:
    'PBWIN 9.01 - WinApi 05/2008 - XP Pro SP3
    #Dim All 
    #Compile Exe  
    #Optimize SPEED
    #Debug Display On'off for production code
     
    #Include "WIN32API.INC"
    #Include "COMDLG32.INC"
    #Include "InitCtrl.inc"
    '
     'these next included files can be found here: 
     'http://www.powerbasic.com/support/pbforums/showthread.php?t=38904
    #Include "C:\Only_My_Programs\Include Files\ButtonPlus.bas"
    #Resource "C:\Only_My_Programs\Include Files\ButtonPlusDemo.pbr"
    %Button_Ids_Start_At = 1000
    %Id_Exit_Btn = 2000
    '
     Global hdlg As Dword
    ' 
    Macro Common_Locals 'Macro easier than retyping and maintains coding consistency
      Local Dlg_hght, Dlg_Wd As Long 
      Local Btn_bg_Colors() As Long 
      Local clor, Id, Stile, Row, col, hght, wd, Longest,ctr, ln, ln1, i As Long
      Local  l, s As String
      
       Dim Btn_bg_Colors(1 To 10)
       Btn_bg_Colors(1) = %Black 
       Btn_bg_Colors(2) = %Blue    
       Btn_bg_Colors(3) = %Green   
       Btn_bg_Colors(4) = %Cyan    
       Btn_bg_Colors(5) = %Red     
       Btn_bg_Colors(6) = %Magenta 
       Btn_bg_Colors(7) = %Yellow  
       Btn_bg_Colors(8) = %White   
       Btn_bg_Colors(9) = %Gray    
       Btn_bg_Colors(10) = %LtGray  
     
    End Macro  
    '
    CallBack Function Dialog_Processor              
      Common_Locals                                           
      Select Case CbMsg     'This is TO determine the message TYPE 
         '       
         Case %WM_INITDIALOG'<- Initialiaton when the program loads 
         '
         Case %WM_SYSCOMMAND 'Traps Any Alt key but only F4 closes              
         '
         Case %WM_COMMAND  'This processes command messages
           Select Case CbCtl
             Case %Id_Exit_Btn
               Select Case CbCtlMsg        
                  Case 0
                    Dialog End CbHndl 'Applikation beenden
               End Select
           End Select
      End Select
    End Function
    '
    Function PBMain
      Common_Locals
      
       Stile = Stile Or %WS_CAPTION
       Stile = Stile Or %WS_SYSMENU
       Stile = Stile Or %WS_THICKFRAME 
       Stile = Stile Or %WM_HELP 
       Stile = Stile Or %WS_Border  'doesn't do anything
      Dlg_hght = 400
      Dlg_Wd = 250
       l$ = Space$(Dlg_Wd \ 8)  
       CSet l$ = "Coloring Button Demo"
      Dialog New Pixels, hdlg, l$, , , Dlg_Wd, Dlg_Hght, Stile To hdlg 'centered
      Row = 10
      col = 10
      Wd = 100
      Hght = 20
      Stile = %ss_center
      For ctr = LBound(Btn_bg_Colors())  To UBound(Btn_bg_Colors())
        Clor = Btn_bg_Colors(ctr)    'bg color to use
        Id = %Button_Ids_Start_At + ctr    
        Control Add Label, hdlg, Id, "label", Col, Row, Wd, Hght, stile                
          Control Set Color hdlg, Id, %White, Clor
    '
        Control Add Button, hdlg, Id + 100, "Button", col + wd + 10, row, Wd, Hght, 0 'style must be 0 or 1 - see docs in ButtonPlus.bas
          ButtonPlus hDlg, Id + 100, %BP_FACE_COLOR, Clor
        Row = Row + Hght + 5
      Next ctr
       
              
     
       hght = 25   
       Wd = Dlg_Wd - 20
       Col = 10 'center
    
       Row = Dlg_hght - Hght - 2 'Just off bottom
         Control Add Button, hdlg, %Id_Exit_Btn, "Run Rabbit Run.", col, row, Wd, Hght
          ButtonPlus hDlg, %Id_Exit_Btn, %BP_FACE_COLOR, %Red
          ButtonPlus hDlg, %Id_Exit_Btn, %BP_Text_COLOR, %Yellow
      
         Dialog Show Modal hDlg   Call Dialog_Processor
    End Function  'Applikation beenden
    '
    Not complaining, just observing.

    Also the Btn_Demo (attached below) I first posted has a serious error. The Big Dummy had dimmed the bg colors() as integer instead of long. The colors still don't come out right (bug in MY code for certain, but dogged if I can find it). Problem is unrelated to anomaly above, though.

    ====================================
    So often we rob tomorrow’s memories
    by today’s economies.
    John Mason Brown
    ====================================
    Attached Files

    Leave a comment:

Working...
X
😀
🥰
🤢
😎
😡
👍
👎