Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Draw your own controls. No more square buttons.


  • Please log in to reply
38 replies to this topic
specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007

Area as Control.ahk
Select any image for a gui background and any area of the image, any shape or size, to use for controls.
Say Bye to square buttons.
Version 1.01 uploaded 12/13/11

Continuing with idea of using winset for creating gui controls, I have a new idea to use just one image for the entire gui, including the background and controls. This script retrieves the size of a selected image, loads it into a gui sized for it and provides functions to select areas of the image for controls. It then saves the information into a new script where you can add labels for your newly defined controls. The new controls are transparent gui windows docked over your image and shaped with "WinSet,Region". As such the controls can be any shape at all.

Downloads: Re-Upped 8-21-12
Area as Control.zip, script and help file zipped.

 

Examples in following post have been re-upped 3-3-13.

Updates, 12/15/11
*Now creates a separate script with blank subroutines for your defined controls. This is the only script you need to edit.
*All controls are now automatically added to the mouse over effect list.
*Your created script can be ran without editing to view the mouse over effect. If you added a control named "Exit", it will be active and close the script.
*New help document.Updates,
* Added drag and drop an image onto the file select gui.
* Added "Shift" as hotkey to add points on the fly.
* Changed the "Close Region" hotkey to "Space" which already checks/unchecks the activate tracing box as needed.
* Deactivated the gui move function while tracing is active. This solved the problem of using a tablet stylus for tracing and added the advantage of holding down the left mouse button or using the stylus for constant tracing, as apposed to point to point, but creates many more points per control. To trace point to point with a stylus, hover between points and click or press shift to add points. You may have to click (touch stylus to screen) and move slightly to get it to register a point.
* Changed how gdip is loaded and stopped.
* Fixed help button.
* Now adds "Return" to the end of your new script so you don't have too.

Tip: "Exit" is a pre-existing label in your new script. If you name one of your controls Exit it will be active when you run your script. No need to create a subroutine for it. If you should start your new script without adding an exit button, "Esc::" is the default exit hotkey.


Here is an example of it's use. Click the first point to select. Move the mouse to the second point, the trace line is white. Click the second point, the trace turns yellow marking the selection. Trace the entire outline of your control, press "Delete" to close it. The points defined by the trace are used with the "WinSet, Region" command in the final script.
example.jpg
Trace all the areas to be used as controls. A script is created with your image as a background and your controls active.

Area as Control uses two function libraries,
GDIP.ahk for creating the controls,
Dock_A to hold it all together.

Examples have been moved to next post.

Basic use,
1. Select an image.
2. Name the image and first control.
3. Define a control area by drawing a line around it.
4. Name and define the rest of the controls.
5. Open (YourScriptName)_Subroutines.ahk and add commands to the subroutines.
In the latest version the mouse over functions are automatically assigned. All controls are added, you only need to edit it to change the mouse over effect.

I'm pasting the script here to protect from losing it again.

; Area as Control/Draw Your Own Labels version 1.1
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
#SingleInstance, Force
DetectHiddenText, On
DetectHiddenWindows, On
/*
If !pToken := Gdip_Startup()
{
MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system
ExitApp
}
*/

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Select Image Gui
Gui, Add, Edit, x10 y10 w370 r1 vfile, Select an image.
Gui, Add, Button, x+5 w20 h20 gGetFile, ...
Gui, Add, Button, x10 y40 Disabled vGetSize gGetSize, Load Selected Image
Gui, Add, Button, x385 y40 w20 h20 gHelp, ?
Gui, Add, Text, x+5 w50 vdtext,
Gui, Show, w410 h70, Select Image
Return

getfile: ; Select the image to use.
FileSelectFile, selectedfile, 1, , , Image(*.GIF;*.JPG;*.BMP;*.PNG)
GuiControl, , file, %selectedfile%
GuiControl, Enable, GetSize,
Return

GuiDropFiles:
Loop, parse, A_GuiEvent, `n
{
FirstFile = %A_LoopField%
Break
}
GuiControl, , file, %FirstFile%
GetSize: ;;;;;;;;;;;;;;;;;;;;;;; Get image dimensions gui.
Gui, Submit, NoHide
If file =
{
GuiControl, , file, Please select an image first.
Return
}
If file = Please select an image first.
Return

result := ImageWxH(file)
Gui, Destroy
StringSplit, Size, result, x,
Gui, Add, Pic, x0 y0 w%Size1% h%Size2% vPic1 gPic1, %file% ; Open image in new gui.

If Size1 < 200 ; Set minimum gui width
Size1 = 200
;;;;;;;;;;;;;;;;;; Add Tracing Controls ;;;;;;;
gbw := Size1-10
ebw := Size1-20
Gui, Add, Edit, w%ebw% r1 Hidden vGuiNum, 10
Gui, Add, Edit, xs y+5 w%ebw% Hidden vGetPoints,
Gui, Add, GroupBox, x5 y%Size2% w%gbw% h96 ,
Gui, Add, Checkbox, xp+5 yp+10 w%ebw% Section Disabled vBox1 gBox1, Tracing Off.

Gui, Add, Edit, xs y+3 w%ebw% r1 vGuiName gGuiName, Name Your Gui ; GuiName
Gui, Add, Edit, xs y+2 w%ebw% r1 vControlName gControlName, Name Your Control ; ControlName

Gui, Add, Button, xs ys+63 w20 h20 gExit, X
Gui, Add, Button, x+5 w20 h20 gHelp, ?
Gui, Add, Button, x+5 w70 h20 Disabled vAddControl gAddControl, Add Control
Gui, Add, Button, x+5 w50 h20 gClear, Clear

Gui, +LastFound -Caption
ShowSize := Size2+100
Gui, Show, w%Size1% h%ShowSize%, Define Areas As Controls
WinGet, IDG1, ID, Area as Label
Return

AddControl:
GuiControl, , Box1, 0
GuiControl, Disable, Box1,
Gui, Submit, NoHide
IfNotExist , %GuiName%
{
FileCreateDir, %GuiName%
FileCopy, %file%, %GuiName%\*.*, 0
FileAppend, , %GuiName%\%GuiName%_Subroutines.ahk
}
IfNotExist , %GuiName%\%GuiName%.ahk
{
GoSub AXtext
FileAppend, %AXtext%, %GuiName%\%GuiName%.ahk
}
IfNotExist , %GuiName%\%GuiName%_MouseOverRules.ahk
{
GoSub MOText
FileAppend, %MOText%, %GuiName%\%GuiName%_MouseOverRules.ahk
}
StringReplace, ControlName, ControlName, %A_Space%, _, All
Add_Control(GuiNum,Size1,Size2,ControlName,GuiName,GetPoints)
GuiControl, Disable, GuiName,
GuiControl, Disable, AddControl,

GoSub Clear
GoSub Box1
GuiControl, , ControlName, Name Your Control
Return

GuiName:
ControlName:
Gui, Submit, NoHide
If GuiName =
Return
If GuiName = Name Your Gui
Return
If ControlName =
Return
If ControlName = Name Your Control
Return
GuiControl, Enable, Box1,
Return

Pic1: ;;;;;;;;;;;;;;;;;;;;;;;;;;;; Move gui by clicking on your pic.
Gui, Submit, NoHide
If Box1 = 1
Return
WinActivate, Area as Label
PostMessage, 0xA1, 2,,, A
Loop,
{
KeyIsDown := GetKeyState("LButton")
If KeyIsDown = 1
Sleep, 50
If KeyIsDown = 0
Break
}
Return

Box1:
Gui, Submit, NoHide
If Box1 = 1
{
SetSystemCursor("IDC_Cross")
GuiControl, , Box1, Tracing On. Mouse over here or Space to stop.
OnMessage(0x201, "WM_LBUTTONDOWN")
}
If Box1 = 0
{
GuiControl, , Box1, Tracing Off.
RestoreCursors()
}
Return

WM_LBUTTONDOWN()
{
Gui, Submit, NoHide
If A_Gui = 1
{
Start_Trace()
}

}
Return

Clear:
Gui, Submit, NoHide
GuiControlGet, ControlName
WinClose, %ControlName%
Gui, %GuiNum%:Destroy
Return

Help:
IfExist, Area as Control Help.html
Run, Area as Control Help.html
Else, MsgBox , 1, File Not Found, Help file not found.`nDownload it now?,
IfMsgBox, Ok
{
UrlDownloadToFile, http://www.autohotkey.net/~specter333/Area_as_Control/Area as Control Help.zip, Area as Control Help.zip
MsgBox, The help file download has started.`nOnce complete, unzip it into the same folder as Area as Control.ahk
}
Return

Esc::
Exit:
GuiClose:
IfExist, %GuiName%\%GuiName%.ahk
{
FileAppend, Return`n, %GuiName%\%GuiName%.ahk
FileAppend, `nReturn`n, %GuiName%\%GuiName%_MouseOverRules.ahk
}
RestoreCursors()
Gdip_Shutdown(pToken)
Gui, Destroy
ExitApp

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Functions ;;;;;;;;;;;;;;;;;


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Retrieve Image Size Function ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ImageWxH(ImageFile) {
;Supports only GIF, JPG, BMP and PNG
IfNotExist, %ImageFile%
Return ""
Size=2592
DHW:=A_DetectHiddenWindows
DetectHiddenWindows, ON
Gui, 99:-Caption
Gui, 99:Margin, 0, 0
Gui, 99:Show,Hide w%Size% h%Size%, ImageWxH.Temporary.GUI
Gui, 99:Add, Picture, x0 y0 , % ImageFile
Gui, 99:Show,AutoSize Hide, ImageWxH.Temporary.GUI
WinGetPos, , ,w,h, ImageWxH.Temporary.GUI
Gui, 99:Destroy
DetectHiddenWindows, %DHW%
Return w "x" h
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Cursor Functions ;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;; Cursor Functions ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
RestoreCursors()
{
SPI_SETCURSORS := 0x57
DllCall( "SystemParametersInfo", UInt,SPI_SETCURSORS, UInt,0, UInt,0, UInt,0 )
}

SetSystemCursor( Cursor = "", cx = 0, cy = 0 )
{
BlankCursor := 0, SystemCursor := 0, FileCursor := 0 ; init

SystemCursors = 32512IDC_ARROW,32513IDC_IBEAM,32514IDC_WAIT,32515IDC_CROSS
,32516IDC_UPARROW,32640IDC_SIZE,32641IDC_ICON,32642IDC_SIZENWSE
,32643IDC_SIZENESW,32644IDC_SIZEWE,32645IDC_SIZENS,32646IDC_SIZEALL
,32648IDC_NO,32649IDC_HAND,32650IDC_APPSTARTING,32651IDC_HELP

If Cursor = ; empty, so create blank cursor
{
VarSetCapacity( AndMask, 32*4, 0xFF ), VarSetCapacity( XorMask, 32*4, 0 )
BlankCursor = 1 ; flag for later
}
Else If SubStr( Cursor,1,4 ) = "IDC_" ; load system cursor
{
Loop, Parse, SystemCursors, `,
{
CursorName := SubStr( A_Loopfield, 6, 15 ) ; get the cursor name, no trailing space with substr
CursorID := SubStr( A_Loopfield, 1, 5 ) ; get the cursor id
SystemCursor = 1
If ( CursorName = Cursor )
{
CursorHandle := DllCall( "LoadCursor", Uint,0, Int,CursorID )
Break
}
}
If CursorHandle = ; invalid cursor name given
{
Msgbox,, SetCursor, Error: Invalid cursor name
CursorHandle = Error
}
}
Else If FileExist( Cursor )
{
SplitPath, Cursor,,, Ext ; auto-detect type
If Ext = ico
uType := 0x1
Else If Ext in cur,ani
uType := 0x2
Else ; invalid file ext
{
Msgbox,, SetCursor, Error: Invalid file type
CursorHandle = Error
}
FileCursor = 1
}
Else
{
Msgbox,, SetCursor, Error: Invalid file path or cursor name
CursorHandle = Error ; raise for later
}
If CursorHandle != Error
{
Loop, Parse, SystemCursors, `,
{
If BlankCursor = 1
{
Type = BlankCursor
%Type%%A_Index% := DllCall( "CreateCursor"
, Uint,0, Int,0, Int,0, Int,32, Int,32, Uint,&AndMask, Uint,&XorMask )
CursorHandle := DllCall( "CopyImage", Uint,%Type%%A_Index%, Uint,0x2, Int,0, Int,0, Int,0 )
DllCall( "SetSystemCursor", Uint,CursorHandle, Int,SubStr( A_Loopfield, 1, 5 ) )
}
Else If SystemCursor = 1
{
Type = SystemCursor
CursorHandle := DllCall( "LoadCursor", Uint,0, Int,CursorID )
%Type%%A_Index% := DllCall( "CopyImage"
, Uint,CursorHandle, Uint,0x2, Int,cx, Int,cy, Uint,0 )
CursorHandle := DllCall( "CopyImage", Uint,%Type%%A_Index%, Uint,0x2, Int,0, Int,0, Int,0 )
DllCall( "SetSystemCursor", Uint,CursorHandle, Int,SubStr( A_Loopfield, 1, 5 ) )
}
Else If FileCursor = 1
{
Type = FileCursor
%Type%%A_Index% := DllCall( "LoadImageA"
, UInt,0, Str,Cursor, UInt,uType, Int,cx, Int,cy, UInt,0x10 )
DllCall( "SetSystemCursor", Uint,%Type%%A_Index%, Int,SubStr( A_Loopfield, 1, 5 ) )
}
}
}
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; Line Functions ;;;;;;;;;;;;;;;;;;

Start_Trace()
{
If !pToken := Gdip_Startup()
{
MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system
ExitApp
}
GuiControlGet, Box1
If Box1 = 0
Return

WinGetPos , ShowX, ShowY, ShowW, ShowH, Define Areas As Controls
Gui, 2: -Caption +E0x80000 +LastFound +OwnDialogs +Owner +AlwaysOnTop
Gui, 2: Show, x%ShowX% y%ShowY% w%ShowW% h%ShowH% NA, TraceLayer ; Show the window
hwnd1 := WinExist() ; Get a handle to this window we have created in order to update it later
Clicked = 0
Pen := Gdip_CreatePen(0xffffffff,1)
MouseGetPos, MouseX, MouseY,
Points = %MouseX%,%MouseY%
LastPoint = %MouseX%,%MouseY%
Loop,
{
GuiControlGet, Box1
If Box1 = 0
Break
MouseGetPos, , Mover
Lbreak := ShowH-96
If Mover > %Lbreak%
{
;MsgBox, %Lbreak%
GuiControl, , Box1, 0
GoSub, Box1
}
WinActivate , Define Areas As Controls
GetKeyState, MState, LButton
If MState = D
GoState = D
GetKeyState, SState, Shift
If SState = D
GoState = D
If GoState = D
{
Clicked := Clicked+1
If Clicked > 1
{
Points = %PrevPoints%|%NowX%,%NowY%
Draw_White_Lines(Points)
GuiControl, , Text1, %Points%
}
PrevPoints = %Points%
MouseGetPos, MouseX, MouseY
GoState = U
}
hbm := CreateDIBSection(ShowW, ShowH) ; Create a gdi bitmap with width and height of what we are going to draw into it. This is the entire drawing area for everything
hdc := CreateCompatibleDC() ; Get a device context compatible with the screen
obm := SelectObject(hdc, hbm) ; Select the bitmap into the device context
G := Gdip_GraphicsFromHDC(hdc) ; Get a pointer to the graphics of the bitmap, for use with drawing functions

MouseGetPos, NowX, NowY
Gdip_DrawLine(G, Pen, MouseX, MouseY, NowX, NowY)

UpdateLayeredWindow(hwnd1, hdc, ShowX, ShowY, ShowW, ShowH)

}

Gdip_DeletePen(Pen)
SelectObject(hdc, obm) ; Select the object back into the hdc
DeleteObject(hbm) ; Now the bitmap may be deleted
DeleteDC(hdc) ; Also the device context related to the bitmap may be deleted
Gdip_DeleteGraphics(G) ; The graphics may now be deleted
Points = %Points%|%LastPoint%
Draw_White_Lines(Points)
StringReplace, RegionPoints, Points, |, %A_Space%, All
StringReplace, RegionPoints, RegionPoints, `,, -, All
NewRegion(RegionPoints)
Gui, 2:Destroy
Gui, 3:Destroy
GuiControl, 1:, GetPoints, %RegionPoints%
}

Draw_White_Lines(Points)
{

WinGetPos , ShowX, ShowY, ShowW, ShowH, Define Areas As Controls
; Create a layered window (+E0x80000 : must be used for UpdateLayeredWindow to work!) that is always on top (+AlwaysOnTop), has no taskbar entry or caption
Gui, 3: -Caption +E0x80000 +LastFound +OwnDialogs +Owner +AlwaysOnTop
Gui, 3: Show, x%ShowX% y%ShowY% w%ShowW% h%ShowH% NA, Layer1 ; Show the window
hwnd3 := WinExist() ; Get a handle to this window we have created in order to update it later
hbm := CreateDIBSection(ShowW, ShowH) ; Create a gdi bitmap with width and height of what we are going to draw into it. This is the entire drawing area for everything
hdc := CreateCompatibleDC() ; Get a device context compatible with the screen
obm := SelectObject(hdc, hbm) ; Select the bitmap into the device context
G := Gdip_GraphicsFromHDC(hdc) ; Get a pointer to the graphics of the bitmap, for use with drawing functions
Pen := Gdip_CreatePen(0xffDAE80F,1)

Gdip_DrawLines(G, Pen, Points)
WinGet, IDG1, ID, Drag Lines Test
WinGet, IDG2, ID, Layer1
DockA(IDG1, IDG2, "x(0) y(0) w() h()")
Gdip_DeletePen(Pen)
UpdateLayeredWindow(hwnd3, hdc, ShowX, ShowY, ShowW, ShowH)

SelectObject(hdc, obm) ; Select the object back into the hdc
DeleteObject(hbm) ; Now the bitmap may be deleted
DeleteDC(hdc) ; Also the device context related to the bitmap may be deleted
Gdip_DeleteGraphics(G) ; The graphics may now be deleted

}


NewRegion(Points)
{
GuiControlGet, GuiName
GuiControlGet, ControlName
If ControlName =
Return
If ControlName = Name Your Control
Return
GuiControl, 1:Enable, AddControl,
GuiControlGet, GuiNum
NewGui:= GuiNum+1
GuiControl, 1:, GuiNum, %NewGui%
WinGetPos , ShowX, ShowY, ShowW, ShowH, Define Areas As Controls
Gui, %NewGui%:Color, Black
Gui, %NewGui%:+LastFound +Toolwindow -Caption
Gui, %NewGui%:Show, x%ShowX% y%ShowY% w%ShowW% h%ShowH%, %ControlName%
WinSet, Transparent, 150, %ControlName%
WinSet, Region, %Points%, %ControlName%
WinGet, IDG1, ID, Define Areas As Controls
WinGet, IDG, ID, %ControlName%
DockA(IDG1, IDG, "x(0) y(0) w() h()")

}

Add_Control(GNum,GW,GH,GName,G1Name,Points)
{
Gdip_Shutdown(pToken)
RegionText =
(Join
WinGetPos , ShowX, ShowY, ShowW, ShowH, %G1Name%`n
Gui, %GNum%:Color, Black`n
Gui, %GNum%:Show, x`%ShowX`% y`%ShowY`% w`%ShowW`% h`%ShowH`% Hide, %GName%`n
WinSet, Transparent, 1, %GName%`n
WinSet, Region, %Points%, %GName%`n
Gui, %GNum%:+LastFound +Toolwindow -Caption`n
Gui, %GNum%:Show, , %GName%`n
WinGet, IDG1, ID, %G1Name%`n
WinGet, IDG, ID, %GName%`n
DockA(IDG1, IDG, "x(0) y(0) w() h()")`n
`n
)
FileAppend, %RegionText%, %G1Name%\%G1Name%.ahk
FileAppend, %GName%`,, %G1Name%\%G1Name%_MouseOverRules.ahk
If GName != Exit
FileAppend, %GName%:`n`nReturn`n`n, %G1Name%\%G1Name%_Subroutines.ahk
}

;;;;;;;;;;;;;;;;;;;;;;;;;; Text Copy ;;;;;;;;;;;;;;;;;;;;;;;;;;

AXtext:
SplitPath, file, FileName
AXtext =
(Join
#NoEnv`nSendMode Input`nSetWorkingDir `%A_ScriptDir`%`n#SingleInstance , Force`nDetectHiddenWindows, On
`n`n
Gui, Add, Pic, x0 y0 w%Size1% h%Size2% vMoveGui gPic1, %FileName%`n
Gui, +LastFound -Caption`n
Gui, Show, w%Size1% h%Size2%, %GuiName%`n
GoSub AddControls`n
SetTimer, OnMouseOver, 100`n
OnMessage(0x201, "WM_LBUTTONDOWN")`n
Return`n
`n
#Include %GuiName%_MouseOverRules.ahk`n
`n
#Include %GuiName%_Subroutines.ahk`n
WM_LBUTTONDOWN()`n
{`n
MouseGetPos, , , OverWin,`n
WinGetTitle, title, ahk_id`%OverWin`%`n
StringReplace, title, title, `%A_Space`%, _, All `n
If IsLabel(title)`n
Gosub, `%title`%`n
}`n
Return`n

Esc::`n
Exit:`n
GuiClose:`n
Gui, Destroy`n
ExitApp`n
`n
Pic1:`n
WinActivate, %GuiName%`n
PostMessage, 0xA1, 2,,, A `n
Loop, `n
{`n
KeyIsDown := GetKeyState("LButton")`n
If KeyIsDown = 1`n
Sleep, 50`n
If KeyIsDown = 0`n
Break`n
}`n
Return`n
`n
AddControls:`n
)
Return

MOText:
MOText =
(Join
OnMouseOver:`n
MouseGetPos, , , OverWin, `n
WinGetTitle, title, ahk_id `%OverWin`%`n
GoSub GetList`n
IfInString, MOList, `%title`%`n
{`n
Loop, 100`n
{`n
SetTrans := A_Index+1`n
If SetTrans = 100`n
Break`n
WinSet, Transparent, `%SetTrans`%, `%title`%`n
}`n
Loop, 100`n
{`n
SetTrans := 100-A_Index`n
If SetTrans = 1`n
Break`n
WinSet, Transparent, `%SetTrans`%, `%title`%`n
}`n
}`n
GetList:`n
MOList =
)
Return

I you need new version of any scripts I haven't re-uploaded yet feel free to pm me.

specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007

Examples of guis made with Area as Label.ahk
Each of these guis demonstrate a different mouse-over effect.
Click the titles to download a zip file containing the script, mouse-over definitions and image.

Evolution Gui
Transparent background, 4 control areas, mouse-over changes text in balloon window.
ev1.pngev2.png


Information Super Highway Signpost
Some of my frequently visited websites. This gui has 7 controls, can you find them all. Uses the fade in/out effect on mouse over. Tip, Click the cap to exit.

Signpost.jpg


Busy Woman
Another transparent background gui. Uses transparent splash text on mouse-over. I called this one "Scheduler", I guess because it looked like she needed one. Nine controls but no subroutines have been added. Click her forehead to exit.

sched.png
 


I you need new version of any scripts I haven't re-uploaded yet feel free to pm me.

TheGreatSwami Woo
  • Members
  • 237 posts
  • Last active: Jan 22 2012 03:31 PM
  • Joined: 26 May 2011
FanFu--ingTastic !!!

kenn
  • Members
  • 407 posts
  • Last active: Jan 14 2015 08:16 PM
  • Joined: 11 Oct 2010
This was my dream script, amazing!!!

specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007
Thanks guys.

How about posting your gui designs here for all to see.
I you need new version of any scripts I haven't re-uploaded yet feel free to pm me.

Drugwash
  • Members
  • 1078 posts
  • Last active: May 24 2016 04:20 PM
  • Joined: 07 Sep 2008
Quick question, before even looking at the code: why are you still using Dock_A? Simply setting main GUI (or picture GUI) as parent would hold them all together (see MyClock).
If you're using WinSet, Transparent then I should just crawl under a bridge and die there, coz it's not Win9x compatible. *sigh*

This aside, it's a very good idea, something I've wanted for many, many years and never got around to even trying. Kudos to you!

P.S. To add an ampersand in a text label you need to duplicate it, i.e. Birthdays && Anniversaries - otherwise you'll get an underscore instead. ;)

(AHK 1.0.48.05 and Win98SE) forever | My scripts are here


specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007
Your probably right about setting the main window as a parent, I haven't tried it with this. I tried it in the early stages of the No Image Gui script and it wouldn't work because some of the windows were overlapping. They keep their position relative to the parent but not to each other, when you clicked on one the other would disappear. But I think by the time the final version was done there were no more overlapping windows. I've gotten used to using Dock_A and didn't even think about trying the parent on this one.

Sorry about using winset transparent, it's the only way I know to make a window invisible but still be able to click on it. I think winset region works on 98 so you could load the same image into every layer then trace and winset region the control area the same way.

I knew there must be some way of getting an ampersand but I was at the point I just wanted to upload the thing and be done with it. That's another one of those proof of concept guis that will never get used so I didn't put as much effort into it as I should have.

Thanks for your input, I'll give the parent thing a try.

Edit:
So I tried using Gui, 11:+owner1, which is what I thought you meant by setting the main window as a parent, and it doesn't work. The controls stays on top of the main window but does not move with it. I looked through your clock script and can not find where you did this. Honestly I don't understand a lot of what's in your clock script so I'm probably looking right at it. Could you clue me in to what I'm missing?
I you need new version of any scripts I haven't re-uploaded yet feel free to pm me.

xsm121
  • Members
  • 4 posts
  • Last active: Jul 02 2011 06:29 PM
  • Joined: 28 May 2009
Thanks for these great scripts , I am trying to modify "Area as Label.ahk"
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#SingleInstance, Force
DetectHiddenText, On
DetectHiddenWindows, On

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;   Select Image Gui
Gui, Add, Edit, x10 y10 w370 r1 vfile,
Gui, Add, Button, x+5 w20 h20 gGetFile, ...
Gui, Add, Button, x10 y+10 gGetSize, Load Selected Image

Gui, Show,, Select Image
Return

getfile: ;  Select the image to use.
FileSelectFile, selectedfile, 1, , , Image(*.GIF;*.JPG;*.BMP;*.PNG)
GuiControl, ,  file, %selectedfile%
Return

GetSize:  ;;;;;;;;;;;;;;;;;;;;;;;     Get image dimensions gui.
Gui, Submit, NoHide
If file =
	{
	GuiControl, , file, Please select an image first.
	Return
	}
If file = Please select an image first.
	Return

result := ImageWxH(file)
Gui, Destroy
StringSplit, Size, result, x,
Gui, Add, Pic, x0 y0 w%Size1% h%Size2% vPic1 gPic1, %file% ;  Open image in new gui.

If Size1 < 200  ; Set minimum gui width
	Size1 = 200
;;;;;;;;;;;;;;;;;;     Add Tracing Controls     ;;;;;;;
gbw := Size1-10
ebw := Size1-20
Gui, Add, Edit, w%ebw% r1 Hidden vGuiNum, 10
Gui, Add, Edit, xs y+5 w%ebw% Hidden vGetPoints,
Gui, Add, GroupBox, x5 y%Size2% w%gbw% h96 ,
Gui, Add, Checkbox, xp+5 yp+10 w%ebw% Section Disabled vBox1 gBox1, Tracing Off.

Gui, Add, Edit, xs y+3 w%ebw% r1 vGuiName gGuiName, Name Your Gui ; GuiName
Gui, Add, Edit, xs y+2 w%ebw% r1 vControlName gControlName, Name Your Control ; ControlName

Gui, Add, Button, xs ys+63 w20 h20 gExit, X
Gui, Add, Button, x+5 w20 h20 gHelp, ?
Gui, Add, Button, x+5 w70 h20 Disabled vAddControl gAddControl, Add Control
Gui, Add, Button, x+5 w50 h20 gClear, Clear

Gui, +LastFound -Caption
ShowSize := Size2+100
Gui, Show, w%Size1% h%ShowSize%, Define Areas As Labels
WinGet, IDG1, ID, Area as Label
Return

AddControl:
GuiControl, , Box1, 0
GuiControl, Disable, Box1,
Gui, Submit, NoHide
IfNotExist , %GuiName%.ahk
	{
	GoSub AXtext
	FileAppend, %AXtext%, %GuiName%.ahk
	}
Add_Control(GuiNum,Size1,Size2,ControlName,GuiName,GetPoints)
GuiControl, Disable, GuiName,
GuiControl, Disable, AddControl,

GoSub Clear
GoSub Box1
GuiControl, , ControlName, Name Your Control
Return

GuiName:
ControlName:
Gui, Submit, NoHide
If GuiName =
	Return
If GuiName = Name Your Gui
	Return
If ControlName =
	Return
If ControlName = Name Your Control
	Return
GuiControl, Enable, Box1,
Return

Pic1:  ;;;;;;;;;;;;;;;;;;;;;;;;;;;;     Move gui by clicking on your pic.
WinActivate, Area as Label
PostMessage, 0xA1, 2,,, A
Loop,
	{
	KeyIsDown := GetKeyState("LButton")
	If KeyIsDown = 1
		Sleep, 50
	If KeyIsDown = 0
		Break
	}
Return

Del::
GuiControl, , Box1, 0
Box1:
Gui, Submit, NoHide
If Box1 = 1
	{
	SetSystemCursor("IDC_Cross")
	GuiControl, , Box1, Tracing On. Mouse over here or Delete to stop.
	OnMessage(0x201, "WM_LBUTTONDOWN")
	}
If Box1 = 0
	{
	GuiControl, , Box1, Tracing Off.
	RestoreCursors()
	}
Return


WM_LBUTTONDOWN()
	{
	Gui, Submit, NoHide
	If A_Gui = 1
		{
		Start_Trace()
		}

	}
Return

Clear:
Gui, Submit, NoHide
GuiControlGet, ControlName
WinClose, %ControlName%
Gui, %GuiNum%:Destroy
Gdip_Shutdown(pToken)
Return

Help:

Return

Esc::
Exit:
GuiClose:

StringTrimRight, ControlName_list, ControlName_list, 1

IfExist , %GuiName%.ahk
	{
FileAppend, Return`n, %GuiName%.ahk
Loop, parse, ControlName_list, `,
	{
AddglabelText =
(Join
`n
%A_LoopField%:`n
MsgBox, %A_LoopField%`n
Return`n
)
FileAppend, %AddglabelText%, %GuiName%.ahk
	}
	}

IfNotExist , MouseOverRules.ahk
	{
	GoSub MOText
	FileAppend, %MOText%, MouseOverRules.ahk
	}
Gui, Destroy
Gdip_Shutdown(pToken)
ExitApp

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;          Functions          ;;;;;;;;;;;;;;;;;


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;     Retrieve Image Size Function   ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
ImageWxH(ImageFile) {
;Supports only GIF, JPG, BMP and PNG
IfNotExist, %ImageFile%
  Return ""
Size=2592
DHW:=A_DetectHiddenWindows
DetectHiddenWindows, ON
Gui, 99:-Caption
Gui, 99:Margin, 0, 0
Gui, 99:Show,Hide w%Size% h%Size%, ImageWxH.Temporary.GUI
Gui, 99:Add, Picture, x0 y0 , % ImageFile
Gui, 99:Show,AutoSize Hide, ImageWxH.Temporary.GUI
WinGetPos, , ,w,h, ImageWxH.Temporary.GUI
Gui, 99:Destroy
DetectHiddenWindows, %DHW%
Return w "x" h
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;     Cursor Functions     ;;;;;;;;;;;;;;;;;;;;;;;;

;;;;;;;;;;     Cursor Functions           ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
RestoreCursors()
{
   SPI_SETCURSORS := 0x57
   DllCall( "SystemParametersInfo", UInt,SPI_SETCURSORS, UInt,0, UInt,0, UInt,0 )
}

SetSystemCursor( Cursor = "", cx = 0, cy = 0 )
{
   BlankCursor := 0, SystemCursor := 0, FileCursor := 0 ; init

   SystemCursors = 32512IDC_ARROW,32513IDC_IBEAM,32514IDC_WAIT,32515IDC_CROSS
   ,32516IDC_UPARROW,32640IDC_SIZE,32641IDC_ICON,32642IDC_SIZENWSE
   ,32643IDC_SIZENESW,32644IDC_SIZEWE,32645IDC_SIZENS,32646IDC_SIZEALL
   ,32648IDC_NO,32649IDC_HAND,32650IDC_APPSTARTING,32651IDC_HELP

   If Cursor = ; empty, so create blank cursor
   {
      VarSetCapacity( AndMask, 32*4, 0xFF ), VarSetCapacity( XorMask, 32*4, 0 )
      BlankCursor = 1 ; flag for later
   }
   Else If SubStr( Cursor,1,4 ) = "IDC_" ; load system cursor
   {
      Loop, Parse, SystemCursors, `,
      {
         CursorName := SubStr( A_Loopfield, 6, 15 ) ; get the cursor name, no trailing space with substr
         CursorID := SubStr( A_Loopfield, 1, 5 ) ; get the cursor id
         SystemCursor = 1
         If ( CursorName = Cursor )
         {
            CursorHandle := DllCall( "LoadCursor", Uint,0, Int,CursorID )
            Break
         }
      }
      If CursorHandle = ; invalid cursor name given
      {
         Msgbox,, SetCursor, Error: Invalid cursor name
         CursorHandle = Error
      }
   }
   Else If FileExist( Cursor )
   {
      SplitPath, Cursor,,, Ext ; auto-detect type
      If Ext = ico
         uType := 0x1
      Else If Ext in cur,ani
         uType := 0x2
      Else ; invalid file ext
      {
         Msgbox,, SetCursor, Error: Invalid file type
         CursorHandle = Error
      }
      FileCursor = 1
   }
   Else
   {
      Msgbox,, SetCursor, Error: Invalid file path or cursor name
      CursorHandle = Error ; raise for later
   }
   If CursorHandle != Error
   {
      Loop, Parse, SystemCursors, `,
      {
         If BlankCursor = 1
         {
            Type = BlankCursor
            %Type%%A_Index% := DllCall( "CreateCursor"
            , Uint,0, Int,0, Int,0, Int,32, Int,32, Uint,&AndMask, Uint,&XorMask )
            CursorHandle := DllCall( "CopyImage", Uint,%Type%%A_Index%, Uint,0x2, Int,0, Int,0, Int,0 )
            DllCall( "SetSystemCursor", Uint,CursorHandle, Int,SubStr( A_Loopfield, 1, 5 ) )
         }
         Else If SystemCursor = 1
         {
            Type = SystemCursor
            CursorHandle := DllCall( "LoadCursor", Uint,0, Int,CursorID )
            %Type%%A_Index% := DllCall( "CopyImage"
            , Uint,CursorHandle, Uint,0x2, Int,cx, Int,cy, Uint,0 )
            CursorHandle := DllCall( "CopyImage", Uint,%Type%%A_Index%, Uint,0x2, Int,0, Int,0, Int,0 )
            DllCall( "SetSystemCursor", Uint,CursorHandle, Int,SubStr( A_Loopfield, 1, 5 ) )
         }
         Else If FileCursor = 1
         {
            Type = FileCursor
            %Type%%A_Index% := DllCall( "LoadImageA"
            , UInt,0, Str,Cursor, UInt,uType, Int,cx, Int,cy, UInt,0x10 )
            DllCall( "SetSystemCursor", Uint,%Type%%A_Index%, Int,SubStr( A_Loopfield, 1, 5 ) )
         }
      }
   }
}

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;     Line Functions     ;;;;;;;;;;;;;;;;;;
Start_Trace()
	{
		global ControlName_list, ControlName
	GuiControlGet, Box1
	If Box1 = 0
		Return
	If !pToken := Gdip_Startup()
		{
		MsgBox, 48, gdiplus error!, Gdiplus failed to start. Please ensure you have gdiplus on your system
		ExitApp
		}
	WinGetPos , ShowX, ShowY, ShowW, ShowH, Define Areas As Labels
	Gui, 2: -Caption +E0x80000 +LastFound +OwnDialogs +Owner +AlwaysOnTop
	Gui, 2: Show, x%ShowX% y%ShowY% w%ShowW% h%ShowH% NA, TraceLayer ; Show the window
	hwnd1 := WinExist() ; Get a handle to this window we have created in order to update it later
	Clicked = 0
	Pen := Gdip_CreatePen(0xffffffff,1)
	MouseGetPos, MouseX, MouseY,
	Points = %MouseX%,%MouseY%
	LastPoint = %MouseX%,%MouseY%
	Loop,
		{
		GuiControlGet, Box1
		If Box1 = 0
			Break
		MouseGetPos, , Mover
		Lbreak := ShowH-96
		If Mover > %Lbreak%
			{
			GuiControl, , Box1, 0
			GoSub, Box1
			ControlName_list := ControlName_list . ControlName . ","
			}
		WinActivate , Define Areas As Labels
		GetKeyState, State, LButton
		If State = D
			{
			Clicked := Clicked+1
			If Clicked > 1
				{
				Points = %PrevPoints%|%NowX%,%NowY%
				Draw_White_Lines(Points)
				GuiControl, , Text1, %Points%
				}
			PrevPoints = %Points%
			MouseGetPos, MouseX, MouseY
			}
		hbm := CreateDIBSection(ShowW, ShowH) ; Create a gdi bitmap with width and height of what we are going to draw into it. This is the entire drawing area for everything
		hdc := CreateCompatibleDC() ; Get a device context compatible with the screen
		obm := SelectObject(hdc, hbm) ; Select the bitmap into the device context
		G := Gdip_GraphicsFromHDC(hdc) ; Get a pointer to the graphics of the bitmap, for use with drawing functions

		MouseGetPos, NowX, NowY
		Gdip_DrawLine(G, Pen, MouseX, MouseY, NowX, NowY)

		UpdateLayeredWindow(hwnd1, hdc, ShowX, ShowY, ShowW, ShowH)

		}

	Gdip_DeletePen(Pen)
	SelectObject(hdc, obm) ; Select the object back into the hdc
	DeleteObject(hbm) ; Now the bitmap may be deleted
	DeleteDC(hdc) ; Also the device context related to the bitmap may be deleted
	Gdip_DeleteGraphics(G) ; The graphics may now be deleted
	Points = %Points%|%LastPoint%
	Draw_White_Lines(Points)
	StringReplace, RegionPoints, Points, |, %A_Space%, All
	StringReplace, RegionPoints, RegionPoints, `,, -, All
	NewRegion(RegionPoints)
	Gui, 2:Destroy
	Gui, 3:Destroy
	GuiControl, 1:, GetPoints, %RegionPoints%
	}

Draw_White_Lines(Points)
	{

	WinGetPos , ShowX, ShowY, ShowW, ShowH, Define Areas As Labels
	; Create a layered window (+E0x80000 : must be used for UpdateLayeredWindow to work!) that is always on top (+AlwaysOnTop), has no taskbar entry or caption
	Gui, 3: -Caption +E0x80000 +LastFound +OwnDialogs +Owner +AlwaysOnTop
	Gui, 3: Show, x%ShowX% y%ShowY% w%ShowW% h%ShowH% NA, Layer1 ; Show the window
	hwnd3 := WinExist() ; Get a handle to this window we have created in order to update it later
	hbm := CreateDIBSection(ShowW, ShowH) ; Create a gdi bitmap with width and height of what we are going to draw into it. This is the entire drawing area for everything
	hdc := CreateCompatibleDC() ; Get a device context compatible with the screen
	obm := SelectObject(hdc, hbm) ; Select the bitmap into the device context
	G := Gdip_GraphicsFromHDC(hdc) ; Get a pointer to the graphics of the bitmap, for use with drawing functions
	Pen := Gdip_CreatePen(0xffDAE80F,1)

	Gdip_DrawLines(G, Pen, Points)
	WinGet, IDG1, ID, Drag Lines Test
	WinGet, IDG2, ID, Layer1
	DockA(IDG1, IDG2, "x(0) y(0) w() h()")
	Gdip_DeletePen(Pen)
	UpdateLayeredWindow(hwnd3, hdc, ShowX, ShowY, ShowW, ShowH)

	SelectObject(hdc, obm) ; Select the object back into the hdc
	DeleteObject(hbm) ; Now the bitmap may be deleted
	DeleteDC(hdc) ; Also the device context related to the bitmap may be deleted
	Gdip_DeleteGraphics(G) ; The graphics may now be deleted
	}


NewRegion(Points)
	{
	GuiControlGet, GuiName
	GuiControlGet, ControlName
	If ControlName =
		Return
	If ControlName =  Name Your Control
		Return
	GuiControl, 1:Enable, AddControl,
	GuiControlGet, GuiNum
	NewGui:= GuiNum+1
	GuiControl, 1:, GuiNum, %NewGui%
	WinGetPos , ShowX, ShowY, ShowW, ShowH, Define Areas As Labels
	Gui, %NewGui%:Color, Black
	Gui, %NewGui%:+LastFound +Toolwindow -Caption
	Gui, %NewGui%:Show, x%ShowX% y%ShowY% w%ShowW% h%ShowH%, %ControlName%
	WinSet, Transparent, 150, %ControlName%
	WinSet, Region, %Points%, %ControlName%
	WinGet, IDG1, ID, Define Areas As Labels
	WinGet, IDG, ID, %ControlName%
	DockA(IDG1, IDG, "x(0) y(0) w() h()")

	}

Add_Control(GNum,GW,GH,GName,G1Name,Points)
	{
	RegionText =
	(Join
	WinGetPos , ShowX, ShowY, ShowW, ShowH, %G1Name%`n
Gui, %GNum%:Color, Black`n
Gui, %GNum%:Show, x`%ShowX`% y`%ShowY`% w`%ShowW`% h`%ShowH`% Hide, %GName%`n
WinSet, Transparent, 1, %GName%`n
WinSet, Region, %Points%, %GName%`n
Gui, %GNum%:+LastFound +Toolwindow -Caption`n
Gui, %GNum%:Show, , %GName%`n
WinGet, IDG1, ID, %G1Name%`n
WinGet, IDG, ID, %GName%`n
DockA(IDG1, IDG, "x(0) y(0) w() h()")`n
`n
	)
	FileAppend, %RegionText%, %G1Name%.ahk
	}

;;;;;;;;;;;;;;;;;;;;;;;;;;      Text Copy     ;;;;;;;;;;;;;;;;;;;;;;;;;;

AXtext:
SplitPath, file, FileName
AXtext =
(Join
#NoEnv`nSendMode Input`nSetWorkingDir `%A_ScriptDir`%`n#SingleInstance , Force`nDetectHiddenWindows, On
`n`n
Gui, Add, Pic, x0 y0 w%Size1% h%Size2% vMoveGui gPic1, %FileName%`n
Gui, +LastFound -Caption`n
Gui, Show, w%Size1% h%Size2%, %GuiName%`n
GoSub AddControls`n
SetTimer, OnMouseOver, 100`n
OnMessage(0x201, "WM_LBUTTONDOWN")`n
Return`n
`n
#Include MouseOverRules.ahk`n
`n
WM_LBUTTONDOWN()`n
	{`n
	MouseGetPos, , , OverWin,`n
	WinGetTitle, title, ahk_id`%OverWin`%`n
	StringReplace, title, title, `%A_Space`%, _, All `n
	If IsLabel(title)`n
		Gosub, `%title`%`n
	}`n
Return`n

Esc::`n
Exit:`n
GuiClose:`n
Gui, Destroy`n
ExitApp`n
`n
Pic1:`n
WinActivate, %GuiName%`n
PostMessage, 0xA1, 2,,, A `n
Loop, `n
	{`n
	KeyIsDown := GetKeyState("LButton")`n
	If KeyIsDown = 1`n
		Sleep, 50`n
	If KeyIsDown = 0`n
		Break`n
	}`n
Return`n
`n
AddControls:`n
)
Return

MOText:
MOText =
(Join
OnMouseOver:`n
MouseGetPos, , , OverWin, `n
WinGetTitle, title, ahk_id `%OverWin`%`n
MOList = %ControlName_list%`n
IfInString, MOList, `%title`%`n
	{`n
	Loop, 100`n
		{`n
		SetTrans := A_Index+1`n
		If SetTrans = 100`n
			Break`n
		WinSet, Transparent, `%SetTrans`%, `%title`%`n
		}`n
	Loop, 100`n
		{`n
		SetTrans := 100-A_Index`n
		If SetTrans = 1`n
			Break`n
		WinSet, Transparent, `%SetTrans`%, `%title`%`n
		}`n
	}`n
Return`n
`n
)
Return


Drugwash
  • Members
  • 1078 posts
  • Last active: May 24 2016 04:20 PM
  • Joined: 07 Sep 2008
You are right, my code is most of the time confusing. :) I'm not using the regular AHK command for this parent thing, simply because I found it wouldn't work as it should; instead, I use a DllCall:
DllCall("SetParent", "UInt", hChild, "UInt", hParent)
This should work correctly. Of course, replace hParent with the main GUI (or picture) handle and hChild with the current GUI handle, as you add them.

Don't worry about WinSet, Transparent - I know it's the easiest way around and it works for modern Windows versions so it's only natural to use it instead of wasting time with workarounds. When time comes, I'll put together my own Region-based script(s).

Anyway, keep up the good work and please don't take offense if I sometimes sound too blunt: I may be in a hurry or tired at the time and prefer to get directly to the point. :oops:

(AHK 1.0.48.05 and Win98SE) forever | My scripts are here


specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007

Thanks for these great scripts , I am trying to modify "Area as Label.ahk"

So did you have a question or just want me to see your modifications? I did a quick scan through the code you posted and nothing caught my attention. If there is something in particular you want me to see please point it out so I don't have to try to remember what I did and what may be new. :?

Feel free to modify it however you wish. Believe me, I know this could have been written better, but for a noob like me it's a wonder it works at all. :lol:


Drugwash, no worries. I haven't taken offense to anything you've suggested. On the contrary, I'm grateful for what you have taught me. If I can replace Dock_A with that one dll call things will be soooo much simpler. I mean, did you see how much of the No Image, Image Gui was Dock_A?

I've kinda gotten to the point where I'm not picking up as much new stuff as I was, so I was thinking I might tear apart your clock script and figure out what some of the things your doing are. There is a lot of stuff in the manual that's not on the "Alphabetical List of Commands" page so if you don't know where to look for something that's not listed it can be hard to find. Worse, if you know you need to do something new but don't know what it is, it's almost impossible to find. When I just sit and read through the manual a lot of what I read doesn't make sense because I have no frame of reference for it.

I think most people who come here have at least a little scripting background or some before hand knowledge, me? Notta, none what so ever, never tried to program before, don't know anyone who does that I can ask questions. So everything I learn I read in the manual or on the forums and much of the time just reading about something doesn't make it's function clear. So the last resort is to find a script that does something similar to what I'm trying to do and reverse engineer it. That is when I see the result I want, try to find the process of how it happened, and it's very difficult to find a script that has just the thing I'm looking for.

So obviously I like to hear myself type. The point was, I see several things in your clock script that look interesting and likely would have been helpful in some of my other scripts. So time permitting, I'll likely dig through and try to learn from it and any suggestion or pointers you can give me is greatly appreciated.

:D
I you need new version of any scripts I haven't re-uploaded yet feel free to pm me.

Drugwash
  • Members
  • 1078 posts
  • Last active: May 24 2016 04:20 PM
  • Joined: 07 Sep 2008
Please feel free to take whatever you may find useful from my scripts. When in doubt, ask. Admittedly, I myself look into the Help manual - very well put together, if I may say - most times, just because I'm quite old too and my memory resembles more and more to swiss cheese (say "cheese" :D ), but I do search in the offline copy of the MSDN library when something I need is not provided by AHK. And I'm not a programmer either - just a guy with too much spare time and ambition. ;)
Oh and trial and error is not a shame either; better than just sit and wait for everything to be brought to you on a silver platter. ;) So I'd say you're doing well. Keep it up! 8)

(AHK 1.0.48.05 and Win98SE) forever | My scripts are here


Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009
:oops: In the first post, the link to Dock_A is incorrect, it should be <!-- m -->http://www.autohotke...pic.php?t=50119<!-- m -->

specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007

:oops: In the first post, the link to Dock_A is incorrect, it should be <!-- m -->http://www.autohotke...pic.php?t=50119<!-- m -->

Thank you for pointing that out. Fixed.

Drugwash, MSDN library??? another great tip on something I knew absolutely nothing about.

I didn't mean to imply that the manual isn't well written. I never work on a script without it being open on the other screen and it contains tons of information. I was just stating the obvious that if you don't know what to look for it's hard to find and therefor you miss learning some of the things you need. Like you didn't know that already.

I'm out on the road again, like I am every week end and I'm getting ready to download and try this out on my tablet. Should be interesting see what kind of guis I can make drawing with the stylus.

Thanks again for the input.

Edit,

AAAAAARRRRRGGGGHHH, It doesn't work with the stylus. Don't know why but it doesn't seem to recognize any but the first point....
I you need new version of any scripts I haven't re-uploaded yet feel free to pm me.

Leef_me
  • Moderators
  • 8510 posts
  • Last active: Sep 10 2015 05:50 AM
  • Joined: 08 Apr 2009

I'm out on the road again, like I am every week end and I'm getting ready to download and try this out on my tablet. Should be interesting see what kind of guis I can make drawing with the stylus.

Edit,

AAAAAARRRRRGGGGHHH, It doesn't work with the stylus. Don't know why but it doesn't seem to recognize any but the first point....

:cry: :cry: :cry: I'm sad for you.

I haven't tried you code to create a gui yet, nor even looked at the code.

But if you'll entertain a SWAG, add another hotkey that triggers "take a point"

specter333
  • Members
  • 627 posts
  • Last active: Oct 07 2016 07:43 AM
  • Joined: 15 Jan 2007

I haven't tried you code to create a gui yet, nor even looked at the code.

But if you'll entertain a SWAG, add another hotkey that triggers "take a point"


A "take a point" hotkey would likely be handy anyway, I may add that. But using a tablet there is no keyboard so it won't help with the stylus. I don't know why it doesn't work yet but I'm sure there is a work around. The stylus is seen as an HID device so if nothing else I could use the click the pen button as a hotkey but then the HID script would have to be running when making guis.

Oh well, I'll figure it out.
Thanks for the suggestion.
I you need new version of any scripts I haven't re-uploaded yet feel free to pm me.