All pastes #184541 Raw Edit

Mine

public text v1 · immutable
#184541 ·published 2006-09-28 00:37 UTC
rendered paste body
#SingleInstance, Force 
#NoEnv 
SetTitleMatchMode, 3 
OnExit, OnExit 

NoteCap = 10 
Loading = 1 

Menu Tray, Icon, %A_ScriptName% 
Menu, Tray, NoStandard 
Menu, Tray, Color, 75E0FF 
Menu, Tray, Add, Create New Note, AddNote 
Menu, Tray, Add 
Menu, Tray, Add, Show Manager, ShowManager 
Menu, Tray, Add, Hide Manager, HideManager 
Menu, Tray, Add 
Menu, Tray, Add, Exit Sticky Notes, GUIExit 

GUI, +ToolWindow 
GUI, Color, 75E0FF 
GUI, Add, Button, w96 h20 gAddNote, New Note 
GUI, Add, Button, w96 h20 gShowAll, Show Notes 
GUI, Add, Button, w96 h20 gHideAll, Hide Notes 
GUI, Add, Button, w96 h20 gTopOrderAll, All On Top 
GUI, Add, Button, w96 h20 gNormalOrderAll, All Normal  
GUI, Show, xCenter y0 AutoSize, Sticky Notes 
GoSub LoadNotes 
Loading =0 
Return 

AddNote: 
CheckFreeWin() 
IfWinExist, Create a Sticky Note 
{ 
   Msgbox Already writing note 
   Gui, 2:Show 
   Return 
} 
GUI, 2:+ToolWindow 
GUI, 2:Color, 75E0FF 
GUI, 2:Add, Edit, w192 h192 vInput BackgroundTrans 
GUI, 2:Add, Button, gCreateSticky, Create Sticky 
GUI, 2:Show, Autosize, Create a Sticky Note 
Return 

CreateSticky: 
GoSub, ShowAll
MakeNote(CheckFreeWin()) 
Return 

CheckFreeWin() 
{ 
Global NoteCap 
Loop, %NoteCap% 
   IfWinNotExist, Note #%A_Index% 
      Return %A_Index% 
MsgBox, 16, Sticky Notes, You have 10 Stickies!`r(Max Limit Reached) 
Exit 
} 

MakeNote(NoteNum){ 
Global 
Local NoteGUI 

NoteGUI := NoteNum + 2 
GUI, 2:Submit 
GUI, %NoteGui%:Color, 75E0FF 
GUI, %NoteGui%:+ToolWindow +Resize +LabelGUISticky 
GUI, %NoteGui%:Add, Text, w192 h192, %Input% 
GUI, %NoteGui%:Show, AutoSize, Note #%NoteNum% 
Note#%NoteNum%Contents = %Input% 
If not Loading 
   SaveNote(NoteNum) 
Input = 
GUI, 2:Destroy 
} 

ShowManager: 
GUI, Show 
Return 

HideManager: 
GUI, Hide 
Return 

ShowAll: 
Loop, %NoteCap% 
WinShow, Note #%A_Index% 
Return 

HideAll: 
Loop, %NoteCap% 
WinHide, Note #%A_Index% 
Return 

TopOrderAll: 
Loop, %NoteCap% 
WinSet, AlwaysOntop, On, Note #%A_Index% 
Return 

NormalOrderAll: 
Loop, %NoteCap% 
WinSet, AlwaysOntop, Off, Note #%A_Index% 
Return 

LoadNotes: 
CurNote = 1 
Loop, Read, Notes.txt 
{ 
If CurNote > 10 
{ 
   MsgBox, 4148,, 
   ( 
Error: 
Do you wish to exit without saving so you can manually clean Notes.txt 
If you choose No and continue the current 10 stickys will overwrite 
all backed up stickys on exit!!! 
   ) 
   IfMsgBox Yes 
   { 
      NOSAVE = 1 
      ExitApp 
   } 
   Else IfMsgBox No 
      Break 
} 
StringLeft, NewWinChk, A_LoopReadLine, 6 
   If (NewWinChk = "[Note,") OR (NewWinChk = "[Note]") 
   { 
      If Input 
      { 
         MakeNote(CurNote) 
         RestNP(CurNote, NWSetings) 
         CurNote ++ 
      } 
      NWSetings := A_LoopReadLine 
   }  Else 
      If not Input 
         Input = %Input%%A_LoopReadLine% 
      Else 
         Input = %Input%`r`n%A_LoopReadLine% 
} 
If Input 
{ 
   MakeNote(CurNote) 
   RestNP(CurNote, NWSetings) 
} 
Return 

RestNP(ByRef NNum, ByRef NWSettings) 
{ 
StringSplit, NWSettings, NWSettings,`,,[] 
WinMove, Note #%NNum%,, %NWSettings2%, %NWSettings3%, %NWSettings4%, %NWSettings5% 
} 

SaveNote(ByRef NoteNum) 
{ 
NoteText := "[Note]`r`n" Note#%NoteNum%Contents "`r`n" 
FileAppend, %NoteText%, *Notes.txt 
} 

SaveNotes: 
AllNotes = 
Loop, %NoteCap% 
IfWinExist, Note #%A_Index% 
{ 
   WinGetPos, X, Y, W, H 
   AllNotes := AllNotes "[Note," X "," Y "," W "," H "]`r`n" Note#%A_Index%Contents "`r`n" 
} 
FileDelete, Notes.txt 
FileAppend, %AllNotes%, *Notes.txt 
Return 

GUIClose: 
GoSub, HideManager
Return

GUIExit: 
GoSub, OnExit
Return

GUIStickySize:
If ErrorLevel = 1 
   Return 
NW := A_GuiWidth - 20 
NH := A_GuiHeight - 10 
GUIControl, MoveDraw, Static1, % "w" NW "h" NH 
Return 

2GUIClose: 
Gui,Destroy 
Return

GUIStickyClose:
MsgBox, 4132, Sticky Notes, Delete this note? 
IfMsgBox No 
Return 
Else IfMsgBox Yes 
GUI, 1:Show 
GUI, Destroy 
Return 

OnExit: 
If not NOSAVE 
   gosub SaveNotes 
Else 
   Msgbox Nothing was overwritten`rPlease go threw the Notes.txt file and`r choose the stickys you wish to keep 
ExitApp