Announcement

Collapse
No announcement yet.

Strethable Dialog

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

  • Steve Bouffe
    replied
    Thanks All, Works a treat

    Leave a comment:


  • Dave Biggs
    replied
    Steve,

    Here are a couple of ways that you can get the effect you are looking for:
    Using a 'ScrollBar' class control..
    Code:
    #Compile Exe
    #Dim All
    #Include "WIN32API.INC"
     
    %LBL_LABEL1    = 101
    %IDC_SIZEGRIP  = 103
    '------------------/
     
    CallBack Function DlgProc()
      Select Case As Long CbMsg
     
        Case %WM_SIZE
          Local GripW, GripH, dWidth, dHeight As Long
          If CbWParam = %SIZE_MAXIMIZED Then
            Control Show State CbHndl, %IDC_SIZEGRIP, %SW_HIDE
          Else
            Control Get Size CbHndl, %IDC_SIZEGRIP To GripW, GripH
            Dialog Get Client CbHndl To dWidth, dHeight
            Control Set Loc CbHndl, %IDC_SIZEGRIP, dWidth - GripW, dHeight - GripH
            Control Show State CbHndl, %IDC_SIZEGRIP, %SW_SHOW
          End If
     
      End Select
    End Function
    '------------------/
     
    Function PBMain()
     Local hDlg  As Dword
     
      Dialog New 0, "'ScrollBar' SizeGrip", , , 200, 120, %WS_CAPTION Or %WS_SYSMENU Or _
        %WS_MINIMIZEBOX Or %WS_MAXIMIZEBOX Or %WS_THICKFRAME, To hDlg
      Control Add Label, hDlg, %LBL_LABEL1, "Dialog needs %WS_THICKFRAME style "+ _
        "and a 'Scrollbar' control with %SBS_SIZEGRIP style", 40, 25, 120, 40
      Control Add ScrollBar, hDlg, %IDC_SIZEGRIP, "", 0, 0, 0, 0, %SBS_RIGHTALIGN Or %SBS_SIZEGRIP
     
      Dialog Show Modal hDlg, Call DlgProc
     
    End Function
    '------------------/
    And using a status bar..
    Code:
    #Compile Exe
    #Dim All
    #Include "WIN32API.INC"
    #Include "COMMCTRL.INC"
     
    %LBL_LABEL1   = 101
    %ID_STATUSBAR = 104
     
    CallBack Function ShowDIALOG1Proc()
      Select Case As Long CbMsg
     
        Case %WM_SIZE
          Control Send CbHndl, %ID_STATUSBAR, CbMsg, CbWParam, CbLParam
     
      End Select
    End Function
    '------------------/
     
    Function PBMain()
     Local hDlg  As Dword, hStatus As Dword, rc As RECT, sTxt As String
     InitCommonControls
     
      Dialog New 0, "StatusBar SizeGrip", 192, 103, 200, 120, %WS_CAPTION Or %WS_SYSMENU Or _
        %WS_MINIMIZEBOX Or %WS_MAXIMIZEBOX Or %WS_THICKFRAME, To hDlg
      Control Add Label, hDlg, %LBL_LABEL1, "Dialog with %WS_THICKFRAME style " + _
        "and StatusBar control", 40, 25, 120, 40
      Control Add "msctls_statusbar32", hDlg, %ID_STATUSBAR, " ", 0, 0, 0, 0, %WS_CHILD Or %WS_VISIBLE 'Or %SBARS_SIZEGRIP
                                                                                                       'added by %WS_THIKFRAME
      Dialog Show Modal hDlg, Call ShowDIALOG1Proc
     
    End Function

    Leave a comment:


  • Steve Bouffe
    replied
    Yes thats what I'm looking for. I added the SBS_SIZEBOX to the DIALOG NEW and I can now resize the dialog. Would I need to create a new control toadd the size grip graphic?

    Leave a comment:


  • Michael Mattias
    replied
    If you mean a "size grip" that's one I asked here and got an answer...

    The 'size grip' control is actually a "scrollbar" control with style SBS_SIZEBOX.

    But I never saw anything special on the taskbar when the window (dialog) was minimized when that window had such a control.

    Leave a comment:


  • Steve Bouffe
    started a topic Strethable Dialog

    Strethable Dialog

    Hello All,

    Been searching the forums but cant find info on how to create a dialog with a stretch control when window is "Restore Down"

    I'm using the %WM_SIZE to resize controls in my callback when maximize and restore down is clicked.
Working...
X