Jump to content

Leaderboard

Popular Content

Showing content with the highest reputation on 06/28/2024 in all areas

  1. ioa747

    Drag-Adjust

    Resize and reposition the GUI controls when the user drags the $DragBar. the $DragBar is invisible, move the mouse between $List1 and $Edit1 and you will see the change in the cursor, then you can do it ; https://www.autoitscript.com/forum/topic/212020-drag-adjust/ ;---------------------------------------------------------------------------------------- ; Title...........: _DragAdjust.au3 ; Description.....: Resize and reposition the GUI controls when the user drags the $DragBar. ; AutoIt Version..: 3.3.16.1 Author: ioa747 ; Note............: Testet in Win10 22H2 ;---------------------------------------------------------------------------------------- #AutoIt3Wrapper_Au3Check_Parameters=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7 #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <ComboConstants.au3> #include <WinAPIGdi.au3> Global $iGuiW = 600, $iMargin = 4 Global $hGUI = GUICreate("Form1", $iGuiW, 315, 205, 130) Global $Combo1 = GUICtrlCreateCombo("Combo1", $iMargin, $iMargin, 196, 25, BitOR($CBS_DROPDOWN, $CBS_AUTOHSCROLL)) Global $List1 = GUICtrlCreateList("", $iMargin, 30, 196, 285) Global $Edit1 = GUICtrlCreateEdit("Edit1", 204, $iMargin, 392, 305) Global $DragBar = GUICtrlCreateLabel("", 200, 0, $iMargin, 315, $SS_CENTERIMAGE, $WS_EX_LAYERED) GUICtrlSetCursor(-1, 13) GUISetState(@SW_SHOW) ;********************************** While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE ExitLoop EndSwitch _DragAdjust() Sleep(10) WEnd ;********************************** Func _DragAdjust() Local Static $iOffset = $iMargin / 2 If Not WinActive($hGUI) Then Return SetError(1, 0, False) Local $ActiveCtrl Local $aCtrl = GUIGetCursorInfo($hGUI) $ActiveCtrl = IsArray($aCtrl) ? $aCtrl[4] : 0 If $ActiveCtrl = $DragBar Then Opt("MouseCoordMode", 2) ;1=absolute, 0=relative, 2=client If $aCtrl[2] = 1 Then ;Primary down While $aCtrl[2] $aCtrl = GUIGetCursorInfo($hGUI) Local $iMp = MouseGetPos(0) < $iMargin ? $iMargin : MouseGetPos(0) > ($iGuiW - $iMargin) ? $iGuiW - $iMargin : MouseGetPos(0) GUICtrlSetPos($DragBar, $iMp - $iOffset) GUICtrlSetPos($Combo1, $iMargin, Default, $iMp - $iMargin - $iOffset) GUICtrlSetPos($List1, $iMargin, Default, $iMp - $iMargin - $iOffset) GUICtrlSetPos($Edit1, $iMp + $iOffset, Default, $iGuiW - $iMp - $iMargin - $iOffset) Sleep(10) WEnd _WinAPI_RedrawWindow($hGUI) EndIf Opt("MouseCoordMode", 1) ;1=absolute, 0=relative, 2=client EndIf EndFunc ;==>_DragAdjust Please, every comment is appreciated! leave your comments and experiences here! Thank you very much
    1 point
  2. Thanks @argumentum I created something like that already. I added VB runtime downloader to it and also config file setup to it since at minimum I like the following settings: Func TweakSciTE() ZipSciteConfigFiles() ; Make a zipped backup of all existing config files ; Create SciTE User Settings file Local $sBatchContent = '' & _ '#SciTE User Settings: ' & @CRLF & _ 'split.vertical=0 ' & @CRLF & _ 'save.session=0 ' & @CRLF & _ 'save.position=1 ' & @CRLF & _ 'output.horizontal.size=300 ' & @CRLF & _ 'fold=1 ' & @CRLF & _ 'fold.on.open=1 ' & @CRLF & _ 'fold.compact=0 ' & @CRLF & _ 'output.initial.hide=0 ' & @CRLF & _ 'line.margin.visible=1 ' & @CRLF & _ 'clear.before.execute=1 ' & @CRLF & _ 'backup.files=0 ' & @CRLF & _ 'indicators.under=0 ' & @CRLF & _ 'open.dialog.in.file.directory=1 ' & @CRLF & _ 'find.use.strip=0 ' & @CRLF & _ 'are.you.sure=1 ' & @CRLF & _ 'statusbar.visible=0 ' & @CRLF Local $sStartupFolder = @HomeDrive & "\Users\" & @UserName & "\" Local $sBatchFilePath = $sStartupFolder & "\SciteUser.properties" FileDelete($sBatchFilePath) If Not FileExists($sStartupFolder) Then DirCreate($sStartupFolder) FileWrite($sBatchFilePath, $sBatchContent) If FileExists($sBatchFilePath) Then SplashTextOn("", "Added & Backed up config", 600, 100) Sleep(1800) SplashOff() Else MsgBox($MB_TOPMOST + 16, "Error", "Failed to create batch script.") EndIf EndFunc
    1 point
  3. Jos

    Autoit get Scite version

    SciTE full or Lite isn't determined by the SciTE version but rather the fact whether autoit3wrapper.au3 is ran on compile/run.
    1 point
  4. Func IsScite_v4() Local $sAutoIt3root = StringLeft(@AutoItExe, StringInStr(@AutoItExe, '\', 0, -1) - 1) Local $sSciteVersion = FileGetVersion($sAutoIt3root & '\SciTE\SciLexer.dll') Return Int($sSciteVersion) = 4 EndFunc ;==>IsScite_v4 Returns true if SciTE is full v. 4.x.x.x
    1 point
×
×
  • Create New...