I managed to restore TabTitiles with spaces
Check all or clear all checkboxes
Re: Check all or clear all checkboxes
I managed to take control of colors on my side, we could have done it before, but cleaning up the options to 0 or 1, it was easier to see.
Re: Check all or clear all checkboxes
Intresting
Tho the zip file isnt healthy so i cant watch what you are doing
Tho the zip file isnt healthy so i cant watch what you are doing
Re: Check all or clear all checkboxes
Final suggestion: write a class to handle "Select XXX" buttons and colors
Code: Select all
;-------------------------------------------------------------------------------
; Menu.ahk
; by wolf_II
;-------------------------------------------------------------------------------
; Challenge: write a class to handle "Select XXX" buttons and colors
#NoEnv
#SingleInstance Force
new Menu("Installatiemenu nov 2018")
.Layout("Registers", "Settings", "Programs")
.Tab_Size(600, 400)
.Show(50, 50)
return ; end of auto-execute section
#Include Pages\Registers.ahk
#Include Pages\Settings.ahk
#Include Pages\Programs.ahk
GuiClose:
ExitApp
;===============================================================================
class Menu { ; handles "Select XXX" buttons and colors
;===============================================================================
;{ Class variables };
static Children := {} ;}
;{ Instance variables };
Tab_Width := A_ScreenWidth // 2
Tab_Height := A_ScreenHeight // 2
Tab_List := "" ;}
__New(WinTitle) { ; constructor
Gui, Menu: New, LabelGui, %WinTitle%
}
Layout(args*) { ; configure
Loop, % args.length() ; FName = also name of #Include-files
FName := args[A_Index], _List .= "|" %FName%()
this.Tab_List := LTrim(_List, "|")
return this ; chain
}
Tab_Size(w, h) { ; configure
this.Tab_Width := w
this.Tab_Height := h
return this ; chain
}
AddText(ByRef Ctrl) { ; populate tab with text
Gui, Add, Text, % Ctrl[1], % Ctrl[2]
}
AddCheckbox(ByRef Box) { ; populate tab in 2 columns
;-----------------------------------
local pos := (Box[4] & 1) ; flip even/odd
? "yp x" this.Tab_Width // 2 ; 2, 4, 6, 8, ...
: "y+3 xs" ; 1, 3, 5, 7, ...
local Color := Box[1] ? "Green Checked" : "Red"
local VarName := Box[2]
local Box_onClick := this.toggleColour.Bind(this)
Gui, Add, Checkbox, %pos% c%Color% v%VarName%, % Box[3]
GuiControl +g, %VarName%, % Box_onClick
}
toggleColour(hWnd) { ; all the Checkboxes come here for colouring
GuiControlGet, State,, %hWnd%
GuiControl, % "+c" (State ? "Green" : "Red"), %hWnd%
}
AddTab(i, ByRef Child) { ; populate Tab2 with child-pages
;-----------------------------------
Gui, Tab, %i%
if (Child.Boxes.Length()) { ; add buttons
Gui, Add, Button, HWNDhAll Section, Select All
Gui, Add, Button, HWNDhNone x+m, Select None
SelectAll_onClick := this.SelectAll.Bind(this)
SelectNone_onClick := this.SelectNone.Bind(this)
GuiControl +g, %hAll%, % SelectAll_onClick
GuiControl +g, %hNone%, % SelectNone_onClick
} else
Gui, Add, Text, w0 h0 Section, dummy
for each, CBox in Child.Boxes
this.AddCheckbox(CBox)
for each, TBox in Child.Texts
this.AddText(TBox)
if (Child.Callback) {
Gui, Add, Button, HWNDhCtrl xs, Start
Start_onClick := Func(Child.Callback).Bind(this)
GuiControl +g, %hCtrl%, % Start_onClick
}
}
SelectAll() { ; all the "Select All" buttons come here
;-----------------------------------
GuiControlGet, Tab_Name,, SysTabControl321
for each, Child in Menu.Children
if (Child.Title = Tab_Name)
break
for each, VarName in Child.VarNames {
GuiControl,, %VarName%, 1
GuiControl, +cGreen, %VarName%
}
}
SelectNone() { ; all the "Select None" buttons come here
;-----------------------------------
GuiControlGet, Tab_Name,, SysTabControl321
for each, Child in Menu.Children
if (Child.Title = Tab_Name)
break
for each, VarName in Child.VarNames {
GuiControl,, %VarName%, 0
GuiControl, +cRed, %VarName%
}
}
Show(x := "Center", y := "Center") { ; create & show GUI
;-----------------------------------
w := this.Tab_Width, h := this.Tab_Height
Gui, Add, Tab2, w%w% h%h%, % this.Tab_List
Gui, Font, s10, Verdana
for i, Child in this.Children ; iterate through tabs
this.AddTab(i, Child)
Gui, Show, x%x% y%y%
}
;===========================================================================
class Page { ; contains various controls, and an optional Start button
;===========================================================================
;{ Instance variables };
Title := "" ; Tab title
CallBack := "" ; Start button
VarNames := [] ; collection
Boxes := [] ; Checkbox controls
Texts := [] ;} Text controls
__New(Title, CallBack := "") { ; constructor
this.Title := Title
this.CallBack := CallBack
Menu.Children.Push(this)
}
AddCheckbox(Flag, VarName, Text) { ; register
this.VarNames.Push(VarName)
this.Boxes.Push([Flag, VarName, Text, this.Boxes.Length()])
return this ; chain
}
AddText(Options, Text) { ; register
this.Texts.Push([Options, Text, this.Texts.Length()])
return this ; chain
}
} ; end of class
} ; end of class
Spoiler
Spoiler
Spoiler
Re: Check all or clear all checkboxes
I will check into that later, the script what i have now, works... and i'm very glad with it
i will let you know how this one is working!
i will let you know how this one is working!
Re: Check all or clear all checkboxes
Hello Mr Wolf_II
i've been away from a while, and started to change the script which i had use for a cople of times, but encountered a few problems with it (renaming a tab with spaces causing errors) so copied and pasted your latest spoilers and now i am working with it, just to let you know..... so i do appriciate your effort and now i'm using your latest build ... tho i just started to convert everything from the old to the new
i've been away from a while, and started to change the script which i had use for a cople of times, but encountered a few problems with it (renaming a tab with spaces causing errors) so copied and pasted your latest spoilers and now i am working with it, just to let you know..... so i do appriciate your effort and now i'm using your latest build ... tho i just started to convert everything from the old to the new
Re: Check all or clear all checkboxes
I just tried to convert some of it, but i aleady stuck.. so i will work with the old script instead and wont take any of your time
Re: Check all or clear all checkboxes
Thanks for the feed back.
In case there is a problem or a feature request, let me know.
Edit: Oops, lemme read first
Edit2: no worries, I have more time than ability, if I can be of help to you, it would be my pleasure.
In case there is a problem or a feature request, let me know.
Edit: Oops, lemme read first
Edit2: no worries, I have more time than ability, if I can be of help to you, it would be my pleasure.
Re: Check all or clear all checkboxes
Thank you, i really appriciate this, i'm still trying to 'understand' your script, but when i was just starting a encounter a problem
when i press Start, nothing happens...
Code: Select all
; Registers.ahk
Registers() {
new Menu.Page(Title := "Registers", "Start_Registers")
.AddCheckbox( 1, "Delete_people_icon", "Delete icon -> People <- from taskbar")
return Title
}
if Delete_people_icon = 1
{
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People , PeopleBand, 00000000
CoordMode, ToolTip
ToolTip , just a second and wait till every script is loaded... Deleting people icon from the taskbar..., 0, 20, WhichToolTip
Sleep, 100
ToolTip
}
Re: Check all or clear all checkboxes
new Menu.Page(Title := "Registers", "Start_Registers") has two parameters,
use the second parameter ("Start_Registers") again for declaring a function like this:I hope that helps.
use the second parameter ("Start_Registers") again for declaring a function like this:
Code: Select all
; Registers.ahk
Registers() {
new Menu.Page(Title := "Registers", "Start_Registers")
.AddCheckbox( 1, "Delete_people_icon", "Delete icon -> People <- from taskbar")
return Title
}
Start_Registers() {
if Delete_people_icon = 1
{
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People , PeopleBand, 00000000
CoordMode, ToolTip
ToolTip , just a second and wait till every script is loaded... Deleting people icon from the taskbar..., 0, 20, WhichToolTip
Sleep, 100
ToolTip
}
}
Re: Check all or clear all checkboxes
Sorry for the mistake... i've seen this 10 seconds before i get to notifcation mail......... but i did :
I've exclude the regwrite to run because of the danger ;P
added a sleep 1000
i should get a tooltip
maybe it just a tooltip problem (i look into it right now)
Code: Select all
; Registers.ahk
Registers() {
new Menu.Page(Title := "Registers", "Start_Registers")
.AddCheckbox( 1, "Delete_people_icon", "Delete icon -> People <- from taskbar")
return Title
}
Start_Registers() {
if Delete_people_icon = 1
{
; RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People , PeopleBand, 00000000
CoordMode, ToolTip
ToolTip , just a second and wait till every script is loaded... Deleting people icon from the taskbar..., 0, 20, WhichToolTip
Sleep, 1000
ToolTip
}
}
added a sleep 1000
i should get a tooltip
maybe it just a tooltip problem (i look into it right now)
Re: Check all or clear all checkboxes
Well i dont know what i am doing wrong...
the msgbox works, tooltip doesnt and the regwrite doesnt do anything too
the msgbox works, tooltip doesnt and the regwrite doesnt do anything too
Code: Select all
; Registers.ahk
Registers() {
new Menu.Page(Title := "Registers", "Start_Registers")
.AddCheckbox( 1, "Delete_people_icon", "Delete icon -> People <- from taskbar")
return Title
}
Start_Registers() {
MsgBox, TEST ; works
if Delete_people_icon = 1 ; does not work
{
RegWrite, REG_DWORD, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People , PeopleBand, 00000000 ; does not work
CoordMode, ToolTip
ToolTip , just a second and wait till every script is loaded... Deleting people icon from the taskbar..., 0, 20, WhichToolTip
Sleep, 1000
ToolTip
}
}
Re: Check all or clear all checkboxes
Oh well, i just deleted 2 }
and now it works.... dont know if it works with other scripts tho.... still busy
Added: no that doesnt work either.......
and now it works.... dont know if it works with other scripts tho.... still busy
Added: no that doesnt work either.......
Re: Check all or clear all checkboxes
Try this:
I hope that helps.
Code: Select all
Start_Registers() {
global
Gui, Submit, NoHide
....
Re: Check all or clear all checkboxes
Ok this is very strange...
i will put the 2 scripts with and without msgbox, the 1st one works a bit, the 2nd doesnt work...
only msgbox makes the difference
i will put the 2 scripts with and without msgbox, the 1st one works a bit, the 2nd doesnt work...
Code: Select all
; Registers.ahk
Registers() {
new Menu.Page(Title := "Registers", "Start_Registers")
.AddCheckbox( 1, "Delete_people_icon", "Delete icon -> People <- from taskbar")
.AddCheckbox( 1, "Folder_options", "Change folder options (unhide and see ext.)")
return Title
}
Start_Registers() {
if Delete_people_icon = 1
MsgBox, TEST
{
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People , PeopleBand, 00000000
CoordMode, ToolTip
ToolTip , just a second and wait till every script is loaded... Deleting people icon from the taskbar..., 0, 20, WhichToolTip
Sleep, 1000
ToolTip
}
}
if Folder_options = 1
{
RegWrite, REG_DWORD, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer, ShowRecent, 00000000
CoordMode, ToolTip
ToolTip , just a second and wait till every script is loaded... Opties voor verkenner zijn ingesteld zoals het zien van verborgen bestanden en extenties verbergen..., 0, 20, WhichToolTip
Sleep, 1000
ToolTip
}
Code: Select all
; Registers.ahk
Registers() {
new Menu.Page(Title := "Registers", "Start_Registers")
.AddCheckbox( 1, "Delete_people_icon", "Delete icon -> People <- from taskbar")
.AddCheckbox( 1, "Folder_options", "Change folder options (unhide and see ext.)")
return Title
}
Start_Registers() {
if Delete_people_icon = 1
{
RegWrite, REG_DWORD, HKEY_CURRENT_USER, Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People , PeopleBand, 00000000
CoordMode, ToolTip
ToolTip , just a second and wait till every script is loaded... Deleting people icon from the taskbar..., 0, 20, WhichToolTip
Sleep, 1000
ToolTip
}
}
if Folder_options = 1
{
RegWrite, REG_DWORD, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer, ShowRecent, 00000000
RegWrite, REG_DWORD, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer, ShowFrequent, 00000000
RegWrite, REG_DWORD, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\CabinetState, FullPath, 00000001
RegWrite, REG_DWORD, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, LaunchTo, 1
RegWrite, REG_DWORD, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, Hidden, 00000001
RegWrite, REG_DWORD, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, HideFileExt, 00000000
RegWrite, REG_DWORD, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced, ShowSuperHidden, 00000001
CoordMode, ToolTip
ToolTip , just a second and wait till every script is loaded... Opties voor verkenner zijn ingesteld zoals het zien van verborgen bestanden en extenties verbergen..., 0, 20, WhichToolTip
Sleep, 1000
ToolTip
}
Re: Check all or clear all checkboxes
Ok, well your suggestion seems to work, only the following line doesnt work
.AddCheckbox( 1, "Folder_options", "Change folder options (unhide and see ext.)")
.AddCheckbox( 1, "Folder_options", "Change folder options (unhide and see ext.)")
Code: Select all
; Registers.ahk
Registers() {
new Menu.Page(Title := "Registers", "Start_Registers")
.AddCheckbox( 1, "Delete_people_icon", "Delete icon -> People <- from taskbar")
.AddCheckbox( 1, "Folder_options", "Change folder options (unhide and see ext.)")
return Title
}
Start_Registers() {
global
Gui, Submit, NoHide
if Delete_people_icon = 1
{
RegWrite, REG_DWORD, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People , PeopleBand, 00000000
CoordMode, ToolTip
ToolTip , just a second and wait till every script is loaded... Deleting people icon from the taskbar..., 0, 20, WhichToolTip
Sleep, 1000
ToolTip
}
}
if Folder_options = 1
{
RegWrite, REG_DWORD, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer, ShowRecent, 00000000
CoordMode, ToolTip
ToolTip , just a second and wait till every script is loaded... Opties voor verkenner zijn ingesteld zoals het zien van verborgen bestanden en extenties verbergen..., 0, 20, WhichToolTip
Sleep, 1000
ToolTip
}
Re: Check all or clear all checkboxes
Try this:
I move one closing curly bracket.
Code: Select all
; Registers.ahk
Registers() {
new Menu.Page(Title := "Registers", "Start_Registers")
.AddCheckbox( 1, "Delete_people_icon", "Delete icon -> People <- from taskbar")
.AddCheckbox( 1, "Folder_options", "Change folder options (unhide and see ext.)")
return Title
}
Start_Registers() {
global
Gui, Submit, NoHide
if Delete_people_icon = 1
{
;~ RegWrite, REG_DWORD, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced\People , PeopleBand, 00000000
CoordMode, ToolTip
ToolTip , just a second and wait till every script is loaded... Deleting people icon from the taskbar..., 0, 20, WhichToolTip
Sleep, 1000
ToolTip
}
if Folder_options = 1
{
;~ RegWrite, REG_DWORD, HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer, ShowRecent, 00000000
CoordMode, ToolTip
ToolTip , just a second and wait till every script is loaded... Opties voor verkenner zijn ingesteld zoals het zien van verborgen bestanden en extenties verbergen..., 0, 20, WhichToolTip
Sleep, 1000
ToolTip
}
}
Re: Check all or clear all checkboxes
haha, well, this is very odd...... when i turn around the order, the script works it should be, so
works:
if Folder_options = 1
if Delete_people_icon = 1
now works:
if Delete_people_icon = 1
if Folder_options = 1
works:
if Folder_options = 1
if Delete_people_icon = 1
now works:
if Delete_people_icon = 1
if Folder_options = 1
Re: Check all or clear all checkboxes
I was too late with my reply..... it works now.......
thanx!
thanx!
Re: Check all or clear all checkboxes
Did you understand why? Look at the closing curly brackets!
I suggest to change the indentation scheme you use.
I suggest to change the indentation scheme you use.
Who is online
Users browsing this forum: Google [Bot], inseption86, Mannaia666 and 140 guests