Jump to content

How do I add a white area and a horizontal line to a form?


Go to solution Solved by argumentum,

Recommended Posts

  • Solution
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Local $iW = 600, $iH = 200
$Form1 = GUICreate("Form1", $iW, $iH)
$Tab1 = GUICtrlCreateTab(0, 0, $iW, 100)
GUICtrlCreateTabItem("")
$Label1 = GUICtrlCreateLabel("Label1", 10, 150, $iW - 20, 1, -1, $WS_EX_STATICEDGE)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

image.png.750072471ae28ad183e854f5858119d0.png

 

Doesn't look that good in all dark mode:
image.png.70609c12aabd848ed363fd04feccdddf.png

( but no one has those for now )

Edited by argumentum

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

image.png.7970bc4cd6d48a8ce071d25aa11d106b.png

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
Local $iW = 600, $iH = 200
$Form1 = GUICreate("Form1", $iW, $iH)
$Tab1 = GUICtrlCreateTab(-10, -10, $iW + 20, 100) ; over extend
GUICtrlCreateTabItem("")
$Label1 = GUICtrlCreateLabel("Label1", 10, 150, $iW - 20, 3, -1, $WS_EX_STATICEDGE) ; thicker separator ?
GUISetState(@SW_SHOW)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            GUIDelete()
            Exit
    EndSwitch
WEnd

...be creative.

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

12 hours ago, argumentum said:

image.png.7970bc4cd6d48a8ce071d25aa11d106b.png

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <TabConstants.au3>
#include <WindowsConstants.au3>
Local $iW = 600, $iH = 200
$Form1 = GUICreate("Form1", $iW, $iH)
$Tab1 = GUICtrlCreateTab(-10, -10, $iW + 20, 100) ; over extend
GUICtrlCreateTabItem("")
$Label1 = GUICtrlCreateLabel("Label1", 10, 150, $iW - 20, 3, -1, $WS_EX_STATICEDGE) ; thicker separator ?
GUISetState(@SW_SHOW)
While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            GUIDelete()
            Exit
    EndSwitch
WEnd

...be creative.

Hi,

Thank you for help, but when I click [Koda] - [File] - [Import] - [Import Autoit GUI] - [Paste code above] - [Process], it has an error like this, How to resolve it?

 

11-23_00-36-16.png

Link to comment
Share on other sites

I use Koda just for the declarations.
Say I need a GUI and a button. I open Koda and add a button.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 494, 303, 192, 124, BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_TABSTOP), BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$Button1 = GUICtrlCreateButton("Button1", 128, 120, 75, 25)
GUICtrlSetResizing(-1, $GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd


Copy that to the script and do the rest manually.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Local $sTitle = "Form1", $iW = 400, $iH = 200
$Form1 = GUICreate($sTitle, $iW, $iH, -1, -1, BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_TABSTOP), BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
Local $Button0, $Button1, $Button2, $Button3
For $n = 0 To 3
    Assign("Button" & $n, GUICtrlCreateButton("Button" & $n + 1, 10 + (95 * $n), 10, 75, 25))
    GUICtrlSetResizing(-1, $GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
Next
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ### <<< no longer importable

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            GUIDelete()
            Exit
    EndSwitch
WEnd

and that will not import. Hence the "be creative" :)

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

8 hours ago, argumentum said:

I use Koda just for the declarations.
Say I need a GUI and a button. I open Koda and add a button.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 494, 303, 192, 124, BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_TABSTOP), BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$Button1 = GUICtrlCreateButton("Button1", 128, 120, 75, 25)
GUICtrlSetResizing(-1, $GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd


Copy that to the script and do the rest manually.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Local $sTitle = "Form1", $iW = 400, $iH = 200
$Form1 = GUICreate($sTitle, $iW, $iH, -1, -1, BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_TABSTOP), BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
Local $Button0, $Button1, $Button2, $Button3
For $n = 0 To 3
    Assign("Button" & $n, GUICtrlCreateButton("Button" & $n + 1, 10 + (95 * $n), 10, 75, 25))
    GUICtrlSetResizing(-1, $GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
Next
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ### <<< no longer importable

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            GUIDelete()
            Exit
    EndSwitch
WEnd

and that will not import. Hence the "be creative" :)

Thank you.:)

Link to comment
Share on other sites

On 11/23/2024 at 1:03 AM, argumentum said:

I use Koda just for the declarations.
Say I need a GUI and a button. I open Koda and add a button.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
$Form1 = GUICreate("Form1", 494, 303, 192, 124, BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_TABSTOP), BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
$Button1 = GUICtrlCreateButton("Button1", 128, 120, 75, 25)
GUICtrlSetResizing(-1, $GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd


Copy that to the script and do the rest manually.

#include <ButtonConstants.au3>
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=
Local $sTitle = "Form1", $iW = 400, $iH = 200
$Form1 = GUICreate($sTitle, $iW, $iH, -1, -1, BitOR($GUI_SS_DEFAULT_GUI,$WS_MAXIMIZEBOX,$WS_SIZEBOX,$WS_THICKFRAME,$WS_TABSTOP), BitOR($WS_EX_TOPMOST,$WS_EX_WINDOWEDGE))
Local $Button0, $Button1, $Button2, $Button3
For $n = 0 To 3
    Assign("Button" & $n, GUICtrlCreateButton("Button" & $n + 1, 10 + (95 * $n), 10, 75, 25))
    GUICtrlSetResizing(-1, $GUI_DOCKRIGHT+$GUI_DOCKTOP+$GUI_DOCKWIDTH+$GUI_DOCKHEIGHT)
Next
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ### <<< no longer importable

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            GUIDelete()
            Exit
    EndSwitch
WEnd

and that will not import. Hence the "be creative" :)

Hi argumentum,

Excuse me, but the controls I've added always have a gap between them and the menu that I cannot eliminate. If I want to have no gap at all, is there a way to remove it?

11-24_10-21-16.png

Link to comment
Share on other sites

Not that I know of.

PS: You may want to select the folder where the dicom files are at, because you're likely to convert all the files for the study. Otherwise you're gonna make the user select each file and would be a pain for the person selecting a bunch of files with numbers as name and is just non-sense for the user.

If you're going to go with each file, pull the header data and give the user: Patient, study date, study Description, series Description and image number, and put it in a listview, so that it makes sense for the user.

Cheers

PS2: You don't have to quote the prior post. I can read the thread :) 

Edited by argumentum
advise ?

Follow the link to my code contribution ( and other things too ).
FAQ - Please Read Before Posting.
autoit_scripter_blue_userbar.png

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...