Hallo alle,
ich bin zwar neu hier, habe aber schon so manches in Autoit gemacht, nur mit der GUI komme ich nicht so gut zurecht...
Aktuell bastele ich schon länger an folgender GUI, bei der ich zwei Probleme haben:
1. Wenn ich das Fenster resize dann verändert sich der Bereich zwischen Listview und edit in der größe
2. bei sehr kleinen oder großen Fenster sieht nicht gut aus, es wäre schön ich könnte zumindest eine Fenstergröße festlegen die nicht unterschritten werden darf
Ich habe schon das eine oder andere versucht, aber die beiden Punkte konnte ich nicht lösen...wäre für tips dankbar !
C
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>
#include <StaticConstants.au3>
#include <Constants.au3>
#include <GuiListView.au3>
$hGUI = GUICreate("My GUI", 540, 500,-1,-1,BitOR($WS_SIZEBOX,$WS_SYSMENU))
$loglistview = GUICtrlCreateListView("Info1|Info2|Info3|Info4|Info5", 10, 10, 520, 200, $LVS_SHOWSELALWAYS)
GUICtrlSetResizing(-1, $GUI_DOCKLEFT+$GUI_DOCKRIGHT + $GUI_DOCKTOP)
_GUICtrlListView_SetColumnWidth($loglistview, 0, 70)
_GUICtrlListView_SetColumnWidth($loglistview, 1, 70)
_GUICtrlListView_SetColumnWidth($loglistview, 2, 70)
_GUICtrlListView_SetColumnWidth($loglistview, 3, 70)
_GUICtrlListView_SetColumnWidth($loglistview, 4, 300)
GUICtrlCreateListViewItem("Some1|info|will|be|added", $loglistview)
GUICtrlCreateListViewItem("Some2|info|will|be|added", $loglistview)
GUICtrlCreateListViewItem("Some3|info|will|be|added", $loglistview)
GUICtrlCreateListViewItem("Some4|info|will|be|added", $loglistview)
GUICtrlCreateListViewItem("Some5|info|will|be|added", $loglistview)
GUICtrlCreateListViewItem("Some6|info|will|be|added", $loglistview)
GUICtrlCreateListViewItem("Some7|info|will|be|added", $loglistview)
GUICtrlCreateListViewItem("Some8|info|will|be|added", $loglistview)
GUICtrlCreateListViewItem("Some9|info|will|be|added", $loglistview)
GUICtrlCreateListViewItem("Some10|info|will|be|added", $loglistview)
GUICtrlCreateListViewItem("Some11|info|will|be|added", $loglistview)
$logedit = GUICtrlCreateEdit("", 10, 255, 520, 210, $WS_VSCROLL + $WS_HSCROLL + $ES_READONLY)
GUICtrlSetBkColor($logedit, "0xffffff")
$dellog = GUICtrlCreateButton("&Delete", 20, 220, 160)
GUICtrlSetResizing(-1, $GUI_DOCKSIZE + $GUI_DOCKHCENTER)
$emaillog = GUICtrlCreateButton("&Mail", 190, 220, 160)
GUICtrlSetResizing(-1, $GUI_DOCKSIZE + $GUI_DOCKHCENTER)
$printlog = GUICtrlCreateButton("&Print", 360, 220, 160)
GUICtrlSetResizing(-1, $GUI_DOCKSIZE + $GUI_DOCKHCENTER)
GUISetState()
GUIRegisterMsg($WM_NOTIFY, "WM_NOTIFY")
_GUICtrlListView_ClickItem($loglistview, 0)
; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()
Switch $msg
Case $GUI_EVENT_CLOSE
ExitLoop
Case $dellog
processlogs("delete")
Case $printlog
processlogs("print")
Case $emaillog
processlogs("mail")
EndSwitch
WEnd
GUIDelete()
Exit
Func WM_NOTIFY($hWnd, $iMsg, $iwParam, $ilParam)
#forceref $hWnd, $iMsg, $iwParam
Local $hWndFrom, $iIDFrom, $iCode, $tNMHDR, $hWndListView, $tInfo
$hWndListView = $loglistview
If Not IsHWnd($loglistview) Then $hWndListView = GUICtrlGetHandle($loglistview)
$tNMHDR = DllStructCreate($tagNMHDR, $ilParam)
$hWndFrom = HWnd(DllStructGetData($tNMHDR, "hWndFrom"))
$iIDFrom = DllStructGetData($tNMHDR, "IDFrom")
$iCode = DllStructGetData($tNMHDR, "Code")
Switch $hWndFrom
Case $hWndListView
Switch $iCode
Case $NM_CLICK ; Sent by a list-view control when the user clicks an item with the left mouse button
$item = _GUICtrlListView_GetItemTextArray($loglistview, -1)
GUICtrlSetData($logedit, $item[1])
EndSwitch
EndSwitch
Return $GUI_RUNDEFMSG
EndFunc ;==>WM_NOTIFY
Func processlogs($action)
MsgBox(0,"To be done",$action)
EndFunc ;==>processlogs
Alles anzeigen