Results 1 to 7 of 7

Thread: Problems / UI / Dialog Set MinSize

  1. #1
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Problems / UI / Dialog Set MinSize

    Hi Eros,

    I found inconsistency between docs and manifested behaviour.
    Docs say DIALOG SET MINSIZE "Set the dialog minimum width and height client area.".
    But I suspect it is not client area, but complete window size.

    Consider following code:
    [code=thinbasic]
    USES "UI"

    DIM hDlg AS DWORD

    DIALOG NEW 0, "Minsizer",1,1, 10, 10, _
    %WS_POPUP Or %WS_VISIBLE Or _
    %WS_CLIPCHILDREN Or %WS_CAPTION OR _
    %WS_SYSMENU Or %WS_MINIMIZEBOX or %WS_THICKFRAME, 0 To hDlg



    dialog set client hDlg, 400,300 ' <-- with this I can get it smaller ( should not be possible )
    'dialog set size hDlg, 400,300 ' <-- with this I cannot
    dialog set minsize hDlg, 400,300

    DIALOG SHOW MODal hDlg, call DlgProc

    DIALOG End hDlg

    callback function DlgProc() as long

    end function
    [/code]

    If MINSIZE would be client related, the window could not be made a bit smaller ... but it can be.


    Petr

    P.S. I think this is the earliest / latest time I ever posted bug description, time to prepare small celebration
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  2. #2
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Problems / UI / Dialog Set MinSize

    Yes, it is a documentation error.
    In reality DIALOG SET MINSIZE ... is used to store info and later handle %WM_GETMINMAXINFO notification: http://msdn.microsoft.com/en-us/library/ms632626(VS.85).aspx
    As I can see there, it talks about windows size and not window client area.

    I will change thinBasic help file.

    Thanks
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  3. #3
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Problems / UI / Dialog Set MinSize

    Next preview refresh will have the following new behave/feature:

    • dialog set minsize ...
      to set the min width/height window size
    • dialog set minclientsize ...
      to set the min width/height client size


    Thanks for testing.
    Eros

    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  4. #4
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Problems / UI / Dialog Set MinSize

    Hi Eros,

    in the latest version, DIALOG SET MINCLIENTSIZE works ok, but DIALOG SET MINSIZE still does not work, following dialog can be made a bit smaller.

    [code=thinbasic]
    USES "UI"

    DIM hDlg AS DWORD

    DIALOG NEW 0, "Minsizer",1,1, 400, 300, _
    %WS_POPUP Or %WS_VISIBLE Or _
    %WS_CLIPCHILDREN Or %WS_CAPTION OR _
    %WS_SYSMENU Or %WS_MINIMIZEBOX or %WS_THICKFRAME, 0 To hDlg

    dialog set minsize hDlg, 400,300

    DIALOG SHOW MODal hDlg, call DlgProc

    DIALOG End hDlg

    callback function DlgProc() as long

    end function
    [/code]


    Thanks,
    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

  5. #5
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Problems / UI / Dialog Set MinSize

    Petr,

    I think it is in reality working fine. The problem is that when the new window is specified having

    If the dialog style includes the %WS_CAPTION style, the width and height parameters specify the client size, not including the caption and border size.
    If the style does not include %WS_CAPTION, the width and height specify the overall dialog size, including the caption and border, if any.
    But this is not documented.

    I will see how to arrange it is such a way it is clear how to use. Maybe I will change something in DIALOG NEW to check if %WS_CAPTION style is present and act according.

    Thanks
    Eros
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  6. #6
    thinBasic author ErosOlmi's Avatar
    Join Date
    Sep 2004
    Location
    Milan - Italy
    Age
    57
    Posts
    8,777
    Rep Power
    10

    Re: Problems / UI / Dialog Set MinSize

    Ok, I think I've got a good compromise.
    DIALOG SET MINSIZE will check if client size is different than window size and make the relevant changes to min/max parameters.

    Attached a corrected UI modue.

    Ciao
    Eros
    Attached Files Attached Files
    www.thinbasic.com | www.thinbasic.com/community/ | help.thinbasic.com
    Windows 10 Pro for Workstations 64bit - 32 GB - Intel(R) Xeon(R) W-10855M CPU @ 2.80GHz - NVIDIA Quadro RTX 3000

  7. #7
    Super Moderator Petr Schreiber's Avatar
    Join Date
    Aug 2005
    Location
    Brno - Czech Republic
    Posts
    7,128
    Rep Power
    732

    Re: Problems / UI / Dialog Set MinSize

    Thanks Eros,

    I am sorry, I should study API more to know the trick with ws_caption.
    But it is working great now, thanks .


    Petr
    Learn 3D graphics with ThinBASIC, learn TBGL!
    Windows 10 64bit - Intel Core i5-3350P @ 3.1GHz - 16 GB RAM - NVIDIA GeForce GTX 1050 Ti 4GB

Similar Threads

  1. DIALOG SET MINSIZE (No MAXSIZE?)
    By marcuslee in forum UI (User Interface)
    Replies: 1
    Last Post: 22-03-2009, 09:24

Members who have read this thread: 0

There are no members to list at the moment.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •