Skip to content

Commit

Permalink
Create Build.ahk during build; Add About tray menu item
Browse files Browse the repository at this point in the history
  • Loading branch information
benallred committed Dec 17, 2015
1 parent e0082cd commit fb2e63f
Show file tree
Hide file tree
Showing 3 changed files with 46 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
SnapX.ini
Build.ahk
Releases/
9 changes: 9 additions & 0 deletions BuildRelease.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,15 @@ function BuildRelease([string]$releaseVersion, [int]$architecture)
Write-Host "Specify release version"
$releaseVersion = Read-Host

$buildInfoFilePath = "Build.ahk"

if (Test-Path $buildInfoFilePath)
{
Remove-Item -Path $buildInfoFilePath
}

Add-Content -Path $buildInfoFilePath -Value "Build := { version: `"$releaseVersion`" }"

BuildRelease $releaseVersion 64
BuildRelease $releaseVersion 32

Expand Down
39 changes: 36 additions & 3 deletions SnapX.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.

null =
ProgramTitle := "SnapX"
Build := { version: "" }
#Include *i Build.ahk

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Script Startup
Expand Down Expand Up @@ -51,7 +53,7 @@ IniRead, horizontalSections, %iniFile%, Settings, horizontalSections, 0
if (!horizontalSections || horizontalSections < 2)
{
SetTimer, ChangeButtonNames_HorizontalSections, 50
MsgBox, 4, %ProgramTitle% Settings, This is your first time running %ProgramTitle%, by Ben Allred.`n`nPlease select your desired horizontal grid size.`n`nThis setting can be changed via the %iniFile% file.`n(Access this by double-clicking the icon in the system tray.)
MsgBox, 4, %ProgramTitle% Settings, This is your first time running %ProgramTitle%, by Ben Allred.`n`nPlease select your desired horizontal grid size.`n`nThis setting can be changed via the %iniFile% file.`n(Access this via the icon in the system tray.)
IfMsgBox, Yes
horizontalSections := 4
else ; No
Expand All @@ -70,9 +72,11 @@ if (!verticalSections || verticalSections < 1)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Tray Menu

Menu, Tray, Add, % ProgramTitle, Tray_Settings
Menu, Tray, Add, % ProgramTitle, Tray_About
Menu, Tray, Icon, % ProgramTitle, shell32.dll, 160
;Menu, Tray, Disable, % ProgramTitle
Menu, Tray, Add, &About, Tray_About
Menu, Tray, Icon, &About, shell32.dll, 222 ; other options: 155, 176, 211, 222, 225, 278
Menu, Tray, Add
Menu, Tray, Add, &Settings, Tray_Settings
Menu, Tray, Icon, &Settings, shell32.dll, 316
Expand All @@ -82,7 +86,7 @@ Menu, Tray, Add, S&uspend, Tray_Suspend
Menu, Tray, Icon, S&uspend, shell32.dll, 145 ; other options: 238, 220
Menu, Tray, Add, E&xit, Tray_Exit
Menu, Tray, Icon, E&xit, shell32.dll, 132
Menu, Tray, Default, &Settings
Menu, Tray, Default, % ProgramTitle
Menu, Tray, Tip, % ProgramTitle

;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Expand Down Expand Up @@ -356,6 +360,35 @@ Tray_Noop(itemName, itemPos, menuName)
{
}

Tray_About(itemName, itemPos, menuName)
{
Global ProgramTitle, Build, debug

Gui, About:New, -MaximizeBox

Gui, About:Font, s24 bold
Gui, About:Add, Text, , % ProgramTitle

Gui, About:Margin, , 0
Gui, About:Font
Gui, About:Add, Text, , % (Build.version ? "v" Build.version : "AutoHotkey script") ", " (A_PtrSize * 8) "-bit" (debug ? ", Debug enabled" : "") (A_IsCompiled ? "" : ", not compiled")

Gui, About:Add, Text, , Copyright (c) Ben Allred

Gui, About:Margin, , 10
Gui, About:Font, s12
Gui, About:Add, Text, , Replacement for Windows/Aero Snap.
Gui, About:Add, Link, , Website: <a href="https://github.com/benallred/SnapX">https://github.com/benallred/SnapX</a>

Gui, About:Margin, , 18
Gui, About:Show, , % ProgramTitle
}

AboutGuiEscape(hwnd)
{
Gui, About:Destroy
}

Tray_Settings(itemName, itemPos, menuName)
{
global iniFile
Expand Down

0 comments on commit fb2e63f

Please sign in to comment.