Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <WindowsConstants.au3>
- #include <Array.au3>
- #include <EditConstants.au3>
- #include <ListboxConstants.au3>
- Opt('GUIResizeMode', 802)
- HotKeySet('!{ESC}', '_Reset')
- Local $hGui, $GuiStyles, $LStyle, $iList, $iCombo, $Input_Styles, $n
- Local $sTitle, $sDefEdit, $sExm
- Local $aStyle[9][3] = [ _
- [8, 0, 0], _
- ['Reset', '$GuiStyles[0]', '$GuiStyles[1]'], _
- ['With border', 'BitOr($WS_BORDER, $WS_POPUP, $WS_SYSMENU)', '0'], _
- ['Stretching window', 'BitOr($WS_OVERLAPPEDWINDOW, $WS_POPUP)', '0'], _
- ['Dragging using the client area', '0', '$WS_EX_CONTROLPARENT'], _
- ['Tool panel', '$GUI_SS_DEFAULT_GUI', '$WS_EX_TOOLWINDOW'], _
- ['Unavailable', 'BitOr($GUI_SS_DEFAULT_GUI, $WS_DISABLED)', '0'], _
- ['System question mark', 'BitOr($WS_SYSMENU, $WS_CAPTION)', '$WS_EX_CONTEXTHELP'], _
- ['About, Credits', 'BitOR($WS_CAPTION, $WS_SYSMENU, $WS_POPUP)', '0']]
- $sTitle = 'Choose a window style'
- $sDefEdit = 'There are styles'
- $sExm = 'Example'
- ; Ru
- ; если русская локализация, то русский язык
- If @OSLang = 0419 Then
- $aStyle[1][0] = 'Сброс'
- $aStyle[2][0] = 'С контуром'
- $aStyle[3][0] = 'Растягивание окна'
- $aStyle[4][0] = 'Перетаскивание за клиентскую область'
- $aStyle[5][0] = 'Инструментальная панелька'
- $aStyle[6][0] = 'Недоступное'
- $aStyle[7][0] = 'Системный знак вопроса'
- $aStyle[8][0] = 'О программе'
- $sTitle = 'Выбирайте стиль окна'
- $sDefEdit = 'Здесь будут стили'
- $sExm = 'Пример'
- EndIf
- $hGui = GUICreate($sTitle, 520, 520)
- $GuiStyles = GUIGetStyle($hGui)
- ; Создаём заполняющий список
- For $i = 1 To $aStyle[0][0]
- $LStyle &= $aStyle[$i][0] & '|'
- Next
- $LStyle = StringTrimRight($LStyle, 1)
- $iList = GUICtrlCreateList('', 5, 5, 240, 420, $LBS_NOINTEGRALHEIGHT)
- GUICtrlSetData(-1, $LStyle, $aStyle[1][0])
- $iCombo = GUICtrlCreateCombo('', 5, 430, 240)
- GUICtrlSetData(-1, $LStyle, $aStyle[1][0])
- $Input_Styles = GUICtrlCreateEdit($sDefEdit, 5, 460, 510, 50, $ES_AUTOVSCROLL)
- GUISetState()
- While 1
- Switch GUIGetMsg()
- Case $iList
- $n = _Style(GUICtrlRead($iList))
- GUICtrlSetData($iCombo, $aStyle[$n][0])
- Case $iCombo
- $n = _Style(GUICtrlRead($iCombo))
- GUICtrlSetData($iList, $aStyle[$n][0])
- Case -3
- Exit
- EndSwitch
- WEnd
- Func _Style($item)
- Local $n = _ArraySearch($aStyle, $item)
- GUISetStyle(1, 1)
- GUISetStyle(Execute($aStyle[$n][1]), Execute($aStyle[$n][2]))
- If $item = $aStyle[1][0] Then
- GUICtrlSetData($Input_Styles, 'GUICreate("' & $sExm & '", 300, 220) ')
- Else
- If $aStyle[$n][2] = '0' Then
- GUICtrlSetData($Input_Styles, 'GUICreate("' & $sExm & '", 300, 220, -1, -1, ' & $aStyle[$n][1] & ')')
- Else
- GUICtrlSetData($Input_Styles, 'GUICreate("' & $sExm & '", 300, 220, -1, -1, ' & $aStyle[$n][1] & ', ' & $aStyle[$n][2] & ')')
- EndIf
- EndIf
- Switch $item
- Case $aStyle[6][0]
- _Enable()
- Case $aStyle[2][0], $aStyle[5][0] ; Случай требующий перерисовки окна
- $aPos = WinGetPos($hGui)
- WinMove($hGui, '', Default, Default, Default, $aPos[3] + 1)
- WinMove($hGui, '', Default, Default, Default, $aPos[3])
- EndSwitch
- Return $n
- EndFunc ;==>_Style
- Func _Reset()
- GUISetStyle($GuiStyles[0], $GuiStyles[1])
- GUICtrlSetData($Input_Styles, $sDefEdit)
- EndFunc ;==>_Reset
- Func _Enable()
- GUICtrlSetBkColor($iList, 0xffd7d7)
- Sleep(2000)
- GUISetStyle($GuiStyles[0], $GuiStyles[1])
- GUICtrlSetBkColor($iList, 0xffffff)
- EndFunc ;==>_Enable
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement