AutoHotkey Community

It is currently May 27th, 2012, 10:32 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Coordinate Color Pick
PostPosted: November 4th, 2007, 11:47 am 
Offline

Joined: May 10th, 2007, 2:52 am
Posts: 194
Location: China/ Canada
http://www.autohotkey.net/~Sakurako/uti ... kGraph.ahk
MD5: 1c313463bfb578cb9cdf6a0bc1360bbd

Code:
;
; AutoHotkey Version: 1.x
; Language:       English (+Chinese Input)
; Platform:       Windows XP
; Author:         Sakurako <sakurakoyao@yahoo.ca>
;
; Script Function:
;   Pick Color
;

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.

Gui +AlwaysOnTop ToolWindow
Gui, Font, s10
Loop, 15
{
 If A_Index > 1
 CoordY -= 15
 VarConvert := A_Index
 Gosub, HexConvert
 RowNum := VarConvert
 Loop, 15
 {
  VarConvert := A_Index
  Gosub, HexConvert
  ColNum := VarConvert
  GuiCreate = %RowNum%%ColNum%
  If GuiCreate = 11
   Gui, Add, Text, x12 v11 gColorPick Center, ■
  Else if ColNum = 1
   Gui, Add, Text, x12 yp+12 v%GuiCreate% gColorPick Center, ■
  Else if ColNum <> 1
   Gui, Add, Text, xp+12 v%GuiCreate% gColorPick Center, ■
 }
}
Gui, Add, Text, x12 cFuchsia, Ctrl+LeftClick to capture
Gui, Add, Text, xp+150 cGreen gExit, Exit
Gui, Show, x465 y465
return

^LButton::
MouseGetPos, CoordX, CoordY
CoordX := CoordX - 8
CoordY := CoordY - 8
Loop, 15
{
 CoordX += 1
 If A_Index > 1
 CoordY -= 15
 VarConvert := A_Index
 Gosub, HexConvert
 ColorPickX := VarConvert
 Loop, 15
 {
  CoordY += 1
  VarConvert := A_Index
  Gosub, HexConvert
  ColorPickY := VarConvert
  ColorPickGraph = %ColorPickY%%ColorPickX%
  PixelGetColor, ColorPickGet, %CoordX%, %CoordY%
  %ColorPickGraph% := ColorPickGet
  Gui, Font, c%ColorPickGet%
  GuiControl, Font, %ColorPickGraph%
  %ColorPickGraph% := "(" CoordX "," CoordY ") " %ColorPickGraph%
 }
}
return

HexConvert:
If VarConvert > 9
{
 If VarConvert = 10
  VarConvert = A
 Else if VarConvert = 11
  VarConvert = B
 Else if VarConvert = 12
  VarConvert = C
 Else if VarConvert = 13
  VarConvert = D
 Else if VarConvert = 14
  VarConvert = E
 Else if VarConvert = 15
  VarConvert = F
}
return

ColorPick:
ColorPickGraph := A_GuiControl
ColorPickGet := %A_GuiControl%
MsgBox, %ColorPickGet%`nActivate the window and press Ctrl+G to get the color of the coordinate
return

^G::
CoordX := SubStr(%ColorPickGraph%, 2, 3)
CoordY := SubStr(%ColorPickGraph%, 6, 3)
PixelGetColor, ColorPickGet, %CoordX%, %CoordY%
MsgBox, (%CoordX%, %CoordY%) %ColorPickGet%
return

F6::Reload
F7::Suspend

Exit:
ExitApp
return


Image


Last edited by Sakurako on January 11th, 2008, 8:05 am, edited 1 time in total.

Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: December 31st, 2007, 4:41 pm 
Offline

Joined: May 10th, 2007, 2:52 am
Posts: 194
Location: China/ Canada
Update: Special Version
Code:
#Persistent
;
; AutoHotkey Version: 1.x
; Language:       English (+Chinese Input)
; Platform:       Windows XP
; Author:         Sakurako <sakurakoyao@yahoo.ca>
;
; Script Function:
;   Pick Color
;

#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.

Goto, ColumnRowSet

^LButton::
;~RButton::
If GenerateReport <= 0
 GenerateReport := 0
MouseGetPos, ColorCheckX, ColorCheckY
WinGetActiveTitle, Window
ColorCheck:
WinActivate, %Window%
WinWaitActive, %Window%
Sleep, 100
CoordX := ColorCheckX - ColumnRangeSet
CoordY := ColorCheckY - RowRangeSet
Loop, %ColumnCheck%
{
 CoordX += 1
 If A_Index > 1
 CoordY -= RowCheck
 ColorPickX := A_Index
 Loop, %RowCheck%
 {
  CoordY += 1
  ColorPickY := A_Index
  ColorPickGraph := SubStr("000" . ColorPickY, -3) SubStr("000" . ColorPickX, -3)
  PixelGetColor, ColorPickGet, %CoordX%, %CoordY%
  %ColorPickGraph% := ColorPickGet
  Gui, Font, c%ColorPickGet%
  GuiControl, Font, %ColorPickGraph%
  %ColorPickGraph% := "(" CoordX ", " CoordY ")   " %ColorPickGraph%
 }
}
return

ColumnRowSet:
Gui, Destroy
Report0 :=
Gui +AlwaysOnTop ToolWindow
Gui, Add, Edit, x10 w50
Gui, Add, UpDown, vColumnRangeSet Range0-400, 7
Gui, Add, Edit, xp+64 w50
Gui, Add, UpDown, vRowRangeSet Range0-300, 7
Gui, Add, Button, x10 gColorGraphSet, Done
Gui, Show,, Column&Row Range
WinWaitClose, Column&Row Range
ColumnCheck := ColumnRangeSet * 2 + 1
RowCheck := RowRangeSet * 2 + 1
GenerateReport := -1
Gui +AlwaysOnTop ToolWindow
Gui, Font, s10
Gui, Add, ComboBox, x12 vVariablePick gVariablePick w90
GuiControl,, VariablePick, Report0
Gui, Add, Button, xp+110 gCopy, Copy to Clipboard
Gui, Add, Text, x12 cFuchsia, Ctrl + Left Click to capture
Gui, Font, s10
Loop, %RowCheck%
{
 If A_Index > 1
 CoordY -= RowCheck
 RowNum := A_Index
 Loop, %ColumnCheck%
 {
  ColNum := A_Index
  Report0 := Report0 "0000"
  GuiCreate := SubStr("000" . RowNum, -3) SubStr("000" . ColNum, -3)
  If GuiCreate = 00010001
   Gui, Add, Text, x12 v11 gColorPick Center, ■
  Else if ColNum = 1
   Gui, Add, Text, x12 yp+12 v%GuiCreate% gColorPick Center, ■
  Else if ColNum <> 1
   Gui, Add, Text, xp+12 v%GuiCreate% gColorPick Center, ■
 }
}
ReportS := Report0
Gui, Font, s10
Gui, Add, Edit, x12 w36
Gui, Add, UpDown, vReportCheck gReportCheck Range-1-3000, 1
Gui, Add, Edit, xp+45 vGenerateColor ReadOnly, 0xFFFFFF
Gui, Add, Button, xp+90 gGenerateSet, Generate Color Report
;Gui, Add, Edit, x12 w50 ReadOnly
;Gui, Add, UpDown, vCoordX1 Range0-800
;Gui, Add, Edit, xp+55 w50 ReadOnly
;Gui, Add, UpDown, vCoordY1 Range0-600
;Gui, Add, Edit, xp+69 w50 ReadOnly
;Gui, Add, UpDown, vCoordX2 Range0-800
;Gui, Add, Edit, xp+55 w50 ReadOnly
;Gui, Add, UpDown, vCoordY2 Range0-600
Gui, Add, Text, x12 cBlue gColorCheck, R
Gui, Add, Text, xp+36 cFuchsia gColumnRowSet, Column && Row
Gui, Add, Text, xp+150 cGreen gExit, Exit
Gui, Show, x465 y465, Color Pick Utility (for AutoHotkey)
return

ColorGraphSet:
Gui, Submit
Gui, Destroy
return

GenerateSet:
If GenerateReport = 2
 Goto, GenerateReport
Else
{
 GenerateReport := 1
 MsgBox, 8256, Generate Report, Select the color to generate report
}
return

GenerateReport:
Report = GCR
Loop, %RowCheck%
{
 RowNum := A_Index
 Loop, %ColumnCheck%
 {
  ColNum := A_Index
  GC_VarCheck := SubStr("000" . RowNum, -3) SubStr("000" . ColNum, -3)
  GC_ColorCheck := SubStr(%GC_VarCheck%, InStr(%GC_VarCheck%, A_Space A_Space A_Space) + 3, 8)
  If (GC_ColorCheck = GenerateColor)
  {
   Report := Report "1"
   StringPos := 4 * ((RowNum - 1) * ColumnCheck + ColNum)
   If StringPos > 4
    Report0 := SubStr(ReportS SubStr(Report0, 1, StringPos - 4), 5 - StringPos) SubStr("000" . SubStr(Report0, StringPos - 3, 4) + 1, -3) SubStr(Report0, StringPos + 1)
   Else if StringPos = 4
    Report0 := SubStr("000" . SubStr(Report0, StringPos - 3, 4) + 1, -3) SubStr(Report0, StringPos + 1)
  }
  Else
   Report := Report "0"
 }
}
Loop, 36
{
 If Report%A_Index%
  continue
 Else
 {
  Report%A_Index% := Report
  GuiControl,, VariablePick, Report%A_Index%
  break
 }
}
return

ReportCheck:
Gui, Submit, NoHide
If ReportCheck = -1
{
 GenerateReport := 0
 MsgBox, 8240, Exit ReportGenerate mode, improper value
 return
}
Loop, %RowCheck%
{
 RowNum := A_Index
 Loop, %ColumnCheck%
 {
  ColNum := A_Index
  GC_VarCheck := SubStr("000" . RowNum, -3) SubStr("000" . ColNum, -3)
  If % SubStr(Report0, 1 + ((RowNum - 1) * ColumnCheck + (ColNum - 1)) * 4, 4) = ReportCheck
  {
   Gui, Font, c%GenerateColor%
   GuiControl, Font, %GC_VarCheck%
   GuiControl,, %GC_VarCheck%, □
  }
  Else
  {
   Gui, Font, cSilver
   GuiControl, Font, %GC_VarCheck%
   GuiControl,, %GC_VarCheck%, ■
  }
 }
}
return

ColorPick:
If GenerateReport = -1
{
 MsgBox, 8256, Color Pick Utility, Press Ctrl + Left Click on center of a pixel region
 return
}
Else if GenerateReport = 0
{
 ColorPickGraph := A_GuiControl
 ColorPickGet := %A_GuiControl%
 MsgBox, 8256, Color Pick, %ColorPickGet%`nActivate the window and press Ctrl+G to get the color of the coordinate
 return
}
Else if GenerateReport = 1
{
 ColorPickGraph := %A_GuiControl%
 GenerateColor := SubStr(ColorPickGraph, InStr(ColorPickGraph, A_Space A_Space A_Space) + 3, 8)
 GuiControl,, GenerateColor, %GenerateColor%
 GenerateReport := 2
 Goto, GenerateReport
}
return

^G::
CoordX := SubStr(ColorPickGet, 2, InStr(SubStr(ColorPickGet, 2, 6), A_Space) - 2)
CoordY := SubStr(ColorPickGet, InStr(ColorPickGet, A_Space)+1, InStr(ColorPickGet, A_Space A_Space A_Space) - InStr(ColorPickGet, A_Space) - 2)
PixelGetColor, ColorPickGet, %CoordX%, %CoordY%
MsgBox, 8256, Color Check, (%CoordX%`, %CoordY%)   %ColorPickGet%
return

F6::Reload
F7::Suspend

Copy:
Gui, Submit, NoHide
If VariablePick
 clipboard := %VariablePick%
Else
 MsgBox, 8256, Variable Information, Select variable
return

VariablePick:
Gui, Submit, NoHide
If VariablePick
 If GenerateReport = 2
 {
  If VariablePick = Report0
   Goto, ReportCheck
  Loop, %RowCheck%
  {
   RowNum := A_Index
   Loop, %ColumnCheck%
   {
    ColNum := A_Index
    GC_VarCheck := SubStr("000" . RowNum, -3) SubStr("000" . ColNum, -3)
    If % SubStr(%VariablePick%, (RowNum - 1) * ColumnCheck + ColNum + 3, 1) = 1
    {
     Gui, Font, c%GenerateColor%
     GuiControl, Font, %GC_VarCheck%
    }
    Else
    {
     Gui, Font, cSilver
     GuiControl, Font, %GC_VarCheck%
    }
   }
  }
 }
return

Exit:
ExitApp
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 4th, 2008, 8:19 am 
Offline

Joined: May 10th, 2007, 2:52 am
Posts: 194
Location: China/ Canada
Further version(s) might not be released for some reason. Also, temporarily development of learning script for listening to reading and communicating would be stopped and might not be open to public before inquire enough information whether it would be legal or not ~

To Chris, regarding previous PM
This would be considered as dangerous script, please neglect the PM. But could it be submitted to Script Showcase? Thanks and sorry ~


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 11th, 2008, 7:55 am 
Offline

Joined: May 10th, 2007, 2:52 am
Posts: 194
Location: China/ Canada
Update: Probably not require Chinese Input
Code:
#Persistent
#NoEnv
;
; AutoHotkey Version: 1.x
; Author:         Sakurako <sakurakoyao@yahoo.ca>
;
; Script Function:
;   Pick Color
;

Goto, ColumnRowSet

^LButton::
;~RButton::
If GenerateReport <= 0
 GenerateReport := 0
MouseGetPos, ColorCheckX, ColorCheckY
WinGetActiveTitle, Window
ColorCheck:
WinActivate, %Window%
WinWaitActive, %Window%
Sleep, 100
CoordX := ColorCheckX - ColumnRangeSet
CoordY := ColorCheckY - RowRangeSet
Loop, %ColumnCheck%
{
 CoordX += 1
 If A_Index > 1
 CoordY -= RowCheck
 ColorPickX := A_Index
 Loop, %RowCheck%
 {
  CoordY += 1
  ColorPickY := A_Index
  ColorPickGraph := SubStr("000" . ColorPickY, -3) SubStr("000" . ColorPickX, -3)
  PixelGetColor, ColorPickGet, %CoordX%, %CoordY%
  %ColorPickGraph% := ColorPickGet
  Gui, Font, c%ColorPickGet%
  GuiControl, Font, %ColorPickGraph%
  %ColorPickGraph% := "(" CoordX ", " CoordY ")   " %ColorPickGraph%
 }
}
return

ColumnRowSet:
Gui, Destroy
Report0 :=
Gui +AlwaysOnTop ToolWindow
Gui, Font
Gui, Add, Edit, x10 w50
Gui, Add, UpDown, vColumnRangeSet Range0-400, 7
Gui, Add, Edit, xp+64 w50
Gui, Add, UpDown, vRowRangeSet Range0-300, 7
Gui, Add, Button, x10 gColorGraphSet, Done
Gui, Show,, Column&Row Range
WinWaitClose, Column&Row Range
ColumnCheck := ColumnRangeSet * 2 + 1
RowCheck := RowRangeSet * 2 + 1
GenerateReport := -1
Gui +AlwaysOnTop ToolWindow
Gui, Font, s10
Gui, Add, ComboBox, x12 vVariablePick gVariablePick w90
GuiControl,, VariablePick, Report0
Gui, Add, Button, xp+110 gCopy, Copy to Clipboard
Gui, Add, Text, x12 cFuchsia, Ctrl + Left Click to capture
Gui, Font, s10
Loop, %RowCheck%
{
 If A_Index > 1
 CoordY -= RowCheck
 RowNum := A_Index
 Loop, %ColumnCheck%
 {
  ColNum := A_Index
  Report0 := Report0 "0000"
  GuiCreate := SubStr("000" . RowNum, -3) SubStr("000" . ColNum, -3)
  If GuiCreate = 00010001
   Gui, Add, Text, x12 v11 gColorPick Center, █
  Else if ColNum = 1
   Gui, Add, Text, x12 yp+12 v%GuiCreate% gColorPick Center, █
  Else if ColNum <> 1
   Gui, Add, Text, xp+12 v%GuiCreate% gColorPick Center, █
 }
}
ReportS := Report0
Gui, Font, s10
Gui, Add, Edit, x12 w36
Gui, Add, UpDown, vReportCheck gReportCheck Range-1-3000, 1
Gui, Add, Edit, xp+45 vGenerateColor ReadOnly, 0xFFFFFF
Gui, Add, Button, xp+90 gGenerateSet, Generate Color Report
;Gui, Add, Edit, x12 w50 ReadOnly
;Gui, Add, UpDown, vCoordX1 Range0-800
;Gui, Add, Edit, xp+55 w50 ReadOnly
;Gui, Add, UpDown, vCoordY1 Range0-600
;Gui, Add, Edit, xp+69 w50 ReadOnly
;Gui, Add, UpDown, vCoordX2 Range0-800
;Gui, Add, Edit, xp+55 w50 ReadOnly
;Gui, Add, UpDown, vCoordY2 Range0-600
Gui, Add, Text, x12 cBlue gColorCheck, R
Gui, Add, Text, xp+36 cFuchsia gColumnRowSet, Column && Row
Gui, Add, Text, xp+150 cGreen gExit, Exit
Gui, Show, x465 y465, Color Pick Utility (for AutoHotkey)
;Gui, Font,, Arial
;Gui, Font,, Times New Roman
return

ColorGraphSet:
Gui, Submit
Gui, Destroy
return

GenerateSet:
If GenerateReport = 2
 Goto, GenerateReport
Else
{
 GenerateReport := 1
 MsgBox, 8256, Generate Report, Select the color to generate report
}
return

GenerateReport:
Report = GCR
Loop, %RowCheck%
{
 RowNum := A_Index
 Loop, %ColumnCheck%
 {
  ColNum := A_Index
  GC_VarCheck := SubStr("000" . RowNum, -3) SubStr("000" . ColNum, -3)
  GC_ColorCheck := SubStr(%GC_VarCheck%, InStr(%GC_VarCheck%, A_Space A_Space A_Space) + 3, 8)
  If (GC_ColorCheck = GenerateColor)
  {
   Report := Report "1"
   StringPos := 4 * ((RowNum - 1) * ColumnCheck + ColNum)
   If StringPos > 4
    Report0 := SubStr(ReportS SubStr(Report0, 1, StringPos - 4), 5 - StringPos) SubStr("000" . SubStr(Report0, StringPos - 3, 4) + 1, -3) SubStr(Report0, StringPos + 1)
   Else if StringPos = 4
    Report0 := SubStr("000" . SubStr(Report0, StringPos - 3, 4) + 1, -3) SubStr(Report0, StringPos + 1)
  }
  Else
   Report := Report "0"
 }
}
Loop, 36
{
 If Report%A_Index%
  continue
 Else
 {
  Report%A_Index% := Report
  GuiControl,, VariablePick, Report%A_Index%
  break
 }
}
return

ReportCheck:
Gui, Submit, NoHide
If ReportCheck = -1
{
 GenerateReport := 0
 MsgBox, 8240, Exit ReportGenerate mode, improper value
 return
}
Loop, %RowCheck%
{
 RowNum := A_Index
 Loop, %ColumnCheck%
 {
  ColNum := A_Index
  GC_VarCheck := SubStr("000" . RowNum, -3) SubStr("000" . ColNum, -3)
  If % SubStr(Report0, 1 + ((RowNum - 1) * ColumnCheck + (ColNum - 1)) * 4, 4) = ReportCheck
  {
   Gui, Font, c%GenerateColor%
   GuiControl, Font, %GC_VarCheck%
   GuiControl,, %GC_VarCheck%, ▓
  }
  Else
  {
   Gui, Font, cSilver
   GuiControl, Font, %GC_VarCheck%
   GuiControl,, %GC_VarCheck%, █
  }
 }
}
return

ColorPick:
If GenerateReport = -1
{
 MsgBox, 8256, Color Pick Utility, Press Ctrl + Left Click on center of a pixel region
 return
}
Else if GenerateReport = 0
{
 ColorPickGraph := A_GuiControl
 ColorPickGet := %A_GuiControl%
 MsgBox, 8256, Color Pick, %ColorPickGet%`nActivate the window and press Ctrl+G to get the color of the coordinate
 return
}
Else if GenerateReport = 1
{
 ColorPickGraph := %A_GuiControl%
 GenerateColor := SubStr(ColorPickGraph, InStr(ColorPickGraph, A_Space A_Space A_Space) + 3, 8)
 GuiControl,, GenerateColor, %GenerateColor%
 GenerateReport := 2
 Goto, GenerateReport
}
return

^G::
CoordX := SubStr(ColorPickGet, 2, InStr(SubStr(ColorPickGet, 2, 6), A_Space) - 2)
CoordY := SubStr(ColorPickGet, InStr(ColorPickGet, A_Space)+1, InStr(ColorPickGet, A_Space A_Space A_Space) - InStr(ColorPickGet, A_Space) - 2)
PixelGetColor, ColorPickGet, %CoordX%, %CoordY%
MsgBox, 8256, Color Check, (%CoordX%`, %CoordY%)   %ColorPickGet%
return

F6::Reload
F7::Suspend

Copy:
Gui, Submit, NoHide
If VariablePick
 clipboard := %VariablePick%
Else
 MsgBox, 8256, Variable Information, Select variable
return

VariablePick:
Gui, Submit, NoHide
If VariablePick
 If GenerateReport = 2
 {
  If VariablePick = Report0
   Goto, ReportCheck
  Loop, %RowCheck%
  {
   RowNum := A_Index
   Loop, %ColumnCheck%
   {
    ColNum := A_Index
    GC_VarCheck := SubStr("000" . RowNum, -3) SubStr("000" . ColNum, -3)
    If % SubStr(%VariablePick%, (RowNum - 1) * ColumnCheck + ColNum + 3, 1) = 1
    {
     Gui, Font, c%GenerateColor%
     GuiControl, Font, %GC_VarCheck%
    }
    Else
    {
     Gui, Font, cSilver
     GuiControl, Font, %GC_VarCheck%
    }
   }
  }
 }
return

Exit:
ExitApp
return


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: January 22nd, 2008, 1:41 am 
Offline

Joined: May 10th, 2007, 2:52 am
Posts: 194
Location: China/ Canada
Icon Pick Utility ~
Code:
IconPickUtility:
Loop
{
 Gui, Destroy
 FileSelectFile, FileName, 2, shell32.dll, Icon Check - Icon Pick Utility, (*.ICO; *.ICL; *.CUR; *.ANI; *.EXE; *.DLL; *.CPL; *.SCR)
 If FileName
 {
  IfNotExist, %FileName%
  {
   FileName := A_WorkingDir "\" SubStr(FileName, InStr(FileName, "\", false, 0) + 1)
   IfNotExist, %FileName%
   {
    FileName := A_ScriptDir "\" SubStr(FileName, InStr(FileName, "\", false, 0) + 1)
    IfNotExist, %FileName%
    {
     FileName := A_Desktop "\" SubStr(FileName, InStr(FileName, "\", false, 0) + 1)
     IfNotExist, %FileName%
     {
      FileName := A_WinDir "\system32\" SubStr(FileName, InStr(FileName, "\", false, 0) + 1)
      IfNotExist, %FileName%
      {
       FileName := A_WinDir "\" SubStr(FileName, InStr(FileName, "\", false, 0) + 1)
       IfNotExist, %FileName%
       {
        Msgbox, 16, Icon Check, % SubStr(FileName, InStr(FileName, "\", false, 0) + 1) " could not be used atm"
        continue
       }
      }
     }
    }
   }
  }
 }
 Else
  FileName := A_WinDir "\system32\shell32.dll"
 Gui, Add, Picture, v_s_e_icon_IconCheck Hwnd_s_e_icon_IconCheck, %FileName%
 GuiControl,, _s_e_icon_IconCheck, *icon0 %FileName%
 ControlGetPos,,,,,, ahk_id %_s_e_icon_IconCheck%
 If ErrorLevel = 0
 {
  Gui, Destroy
  break
 }
 Else
  Msgbox, 48, Icon Check, % "icon in " SubStr(FileName, InStr(FileName, "\", false, 0) + 1) " could not be used atm"
}
Gui, Add, GroupBox, xm w309 h316, Icon List, %FileName%
ANum := 0
Loop, 64
{
 If Mod(A_Index, 8) = 1
  If A_Index = 1
   Gui, Add, Picture, xm+10 yp+23 section vIcon1 gIconPick Icon1 w32 h32 HwndIconCheck, %FileName%
  Else
   Gui, Add, Picture, xm+10 yp+36 section vIcon%A_Index% gIconPick AltSubmit Icon%A_Index% w32 h32 HwndIconCheck, %FileName%
 Else
  Gui, Add, Picture, xp+36 yp+0 vIcon%A_Index% gIconPick AltSubmit Icon%A_Index% w32 h32, %FileName%
 ControlGet, IconCheck0, Style,,, ahk_id %IconCheck%
 If SubStr(IconCheck0, 9) <> 03
  break
}
Gui, Add, Button, xm vIconD gIconCheck, -
Gui, Add, Button, xp+276 vIconIn gIconCheck, +
Loop, 5
{
 IconNumber1 := 210 + A_Index - 1
 If A_Index = 1
 {
  Gui, Add, Picture, xm section vIconPick1 Icon%IconNumber1% w46 h46, %FileName%
  Gui, Add, Edit, xs ys+60 vIconNumber1 gIconCheck, %IconNumber1%
 }
 Else
 {
  If A_Index = 5
   Gui, Add, Picture, ys section vIconPick5 AltSubmit Icon%IconNumber1% w32 h32 HwndIconCheck, %FileName%
  Else
   Gui, Add, Picture, ys section vIconPick%A_Index% AltSubmit Icon%IconNumber1% w32 h32, %FileName%
  Gui, Add, Edit, xs ys+60 vIconNumber%A_Index% ReadOnly, %IconNumber1%
 }
}
Gui, Add, Button, ys+10 vIconCheck gIconCheck Default, Icon Check
Gui, Add, Button, yp+46 gIconPickUtility, File
Loop, 5
{
 IconNumber1 := 210 + A_Index - 1
}
Gui, Show,, Icon Pick Utility
return

IconCheck:
If A_GuiControl = IconNumber1
{
 If IconNum
 {
  IconNum =
  return
 }
 GuiControlGet, IconPick0,, IconNumber1
 Loop
 {
  Sleep, 300
  GuiControlGet, IconNumber1
  If (IconNumber1 = IconPick0)
   break
  IconPick0 := IconNumber1
 }
 If IconNumber1 is not digit
 {
  GuiControl,, IconNumber1, 0
  IconNumber1 = 0
 }
 Else if IconNumber1 =
 {
  GuiControl,, IconNumber1, 0
  IconNumber1 = 0
 }
 Loop, 5
 {
  IconPick0 := IconNumber1 + A_Index - 1
  If A_Index = 1
  {
   GuiControl,, IconPick%A_Index%, *icon%IconPick0% %FileName%
   continue
  }
  Else
  {
   GuiControl,, IconNumber%A_Index%, %IconPick0%
   GuiControl,, IconPick%A_Index%, *icon%IconPick0% %FileName%
  }
 }
 return
}
Else if A_GuiControl = IconD
 IconPick0 := ANum, ANum -= 56
Else if A_GuiControl = IconIn
 IconPick0 := ANum, ANum += 56
Else if A_GuiControl = IconCheck
{
 GuiControlGet, IconNumber1
 ANum := IconNumber1 - 1
 Loop, 5
 {
  IconPick0 := IconNumber1 + A_Index - 1
  If A_Index = 1
   continue
  GuiControl,, IconNumber%A_Index%, %IconPick0%
  GuiControl,, IconPick%A_Index%, *icon%IconPick0% %FileName%
 }
}
Loop, 64
{
 If ANum is not digit
 {
  ANum := 0
  IconNum := A_Index
 }
 Else
  IconNum := ANum + A_Index
 If A_Index = 1
 {
  GuiControl,, IconNumber5, %IconNum%
  GuiControl,, IconPick5, *icon%IconNum% *w32 *h32 %FileName%
  ControlGetPos,,,,,, ahk_id %IconCheck%
  If ErrorLevel = 1
  {
   ANum := IconPick0
   return
  }
 }
 GuiControl,, Icon%A_Index%, *icon%IconNum% %FileName%
}
return

IconPick:
Loop, 5
{
 IconNum := SubStr(A_GuiControl, 5) + ANum + (A_Index - 1)
 GuiControl,, IconNumber%A_Index%, %IconNum%
 GuiControl,, IconPick%A_Index%, *icon%IconNum% %FileName%
}
return

_________________
Sakurako ^_^


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC [ DST ]


Who is online

Users browsing this forum: specter333 and 11 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group