Tải bản đầy đủ (.pdf) (6 trang)

AutoIT Help part 64 potx

Bạn đang xem bản rút gọn của tài liệu. Xem và tải ngay bản đầy đủ của tài liệu tại đây (113.21 KB, 6 trang )

Function Reference
GUICtrlSetResizing
Defines the resizing method used by a control.
GUICtrlSetResizing ( controlID, resizing )
Parameters
controlID
The control identifier (controlID) as returned by a GUICtrlCreate
function.
resizing
See the Docking Values table below for values that can be used (add
together multiple values if required).

Return Value
Success:

Returns 1.
Failure:

Returns 0.

Remarks
When a GUI window is resized the controls within react - how they react is
determined by this function. To be able to resize a GUI window it needs to have
been created with the $WS_SIZEBOX and $WS_SYSMENU styles. See
GUICreate.

Docking Values Table
Resizing

Value


No displacement of

$GUI_DOCKAUTO 1
resize and reposition according to new window
size
$GUI_DOCKLEFT 2 Left side
$GUI_DOCKRIGHT 4 Right side
$GUI_DOCKHCENTER 8 Position will not move relative to horizontal
center
$GUI_DOCKTOP 32 Top side
$GUI_DOCKBOTTOM 64 Bottom side
$GUI_DOCKVCENTER 128
Position will not move relative to vertical
center
$GUI_DOCKWIDTH 256 Width will not change
$GUI_DOCKHEIGHT 512 Height will not change


Composite resizing
$GUI_DOCKSIZE 768 (256+512) Size will not change
$GUI_DOCKMENUBAR

544
(512+32) so the control will stay at the top of
window with no change in Height
$GUI_DOCKSTATEBAR

576
(512+64) so the control stay at the bottom of
the window with no change in Height

$GUI_DOCKALL 802
(2+32+256+512) so the control will not move
during resizing
$GUI_DOCKBORDERS 102
(2+4+32+64) so the control will grow as the
window

The default resizing for a given control is control dependent see the control doc.
A default value for any control can be set with GUIResizeMode (Option).

The automatic resizing event can be disabled if GUIEventOptions (Option) is set to
1.
Related
GUIEventOptions (Option),GUIResizeMode (Option)
Example

#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <EditConstants.au3>

Opt('MustDeclareVars', 1)

Example()

Func Example()
Local $nEdit, $nOk, $nCancel, $msg

Opt("GUICoordMode", 2)
GUICreate("My InputBox", 190, 114, -1, -1, $WS_SIZEBOX +
$WS_SYSMENU) ; start the definition

GUISetIcon("Eiffel Tower.ico")

GUISetFont(8, -1, "Arial")

GUICtrlCreateLabel("Prompt", 8, 7) ; add prompt info
GUICtrlSetResizing(-1, $GUI_DOCKLEFT + $GUI_DOCKTOP)

$nEdit = GUICtrlCreateInput("Default", -1, 3, 175, 20, $ES_PASSWORD) ;
add the input area
GUICtrlSetState($nEdit, $GUI_FOCUS)
GUICtrlSetResizing($nEdit, $GUI_DOCKBOTTOM + $GUI_DOCKHEIGHT)

$nOk = GUICtrlCreateButton("OK", -1, 3, 75, 24) ; add the button that will
close the GUI
GUICtrlSetResizing($nOk, $GUI_DOCKBOTTOM + $GUI_DOCKSIZE +
$GUI_DOCKHCENTER)

$nCancel = GUICtrlCreateButton("Annuler", 25, -1) ; add the button that will
close the GUI
GUICtrlSetResizing($nCancel, $GUI_DOCKBOTTOM + $GUI_DOCKSIZE +
$GUI_DOCKHCENTER)

GUISetState() ; to display the GUI

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd

EndFunc ;==>Example



Function Reference
GUICtrlSetState
thay đổi trạng thái của control.
GUICtrlSetState ( controlID, state )
Parameters
controlID control id
state trạng thái

Return Value
Success:

Returns 1.
Failure:

Returns 0.

Remarks

State table
trạng thái

giải nghĩa

ko thay đổi 0
$GUI_UNCHECKED Radio, Checkbox hay ListViewItem ko đc tick nữa
$GUI_CHECKED tick vào Radio, Checkbox hay ListViewItem

$GUI_INDETERMINATE
Checkbox having the tristate attribute will be
greyed.
$GUI_AVISTART bắt đầu chạy Avi control
$GUI_AVISTOP tạm dừng Avi control
$GUI_AVICLOSE dừng luôn, xóa bỏ bộ nhớ Avi control
$GUI_DROPACCEPTED Control sẽ chấp nhận kéo thả trên nó
$GUI_NODROPACCEPTED

Control ko chấp nhận kéo thả trên nó
$GUI_SHOW hiện thị Control đã bị ẩn (hide)
$GUI_HIDE ẩn Control
$GUI_ENABLE cho phép control hoạt động
$GUI_DISABLE cho phép control hoạt động
$GUI_FOCUS
ghi chuyển sự tập tring bàn phím và chuột tới
controol
$GUI_NOFOCUS bỏ focus
$GUI_DEFBUTTON đặt control như nút mặc định trên window
$GUI_EXPAND TreeViewItem sẽ hiện thị hết các items con.
$GUI_ONTOP Control sẽ ở trên các control khác

State values can be summed up as for example $GUI_DISABLE + $GUI_HIDE
sets the control in an disabled and hidden state.

If an AVI control has to be hidden with $GUI_HIDE it should be closed with
$GUI_AVICLOSE.

State of a "contextmenu" control cannot be changed.
State of a "listviewitem" control can be changed if the associated "listview" control

has been created with an extended style $LVS_EX_CHECKBOXES.
$GUI_FOCUS and $GUI_NOFOCUS can be used on specific listviewitem
provided listview control style allows to display it : $LVS_SHOWSELALWAYS.
State of a "menu or a ""menuitem" control cannot be hidden.

! Important information for $GUI_EXPAND: this state is only used for
TreeViewItems. If you want to use this 'action' then at least 1 Sub-TreeViewItem
has to exist/created under this item !
If you want to select another item in a TreeView then you can use $GUI_FOCUS -
the parent TreeView gets the window focus and the specified item is marked as

Tài liệu bạn tìm kiếm đã sẵn sàng tải về

Tải bản đầy đủ ngay
×