Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
reset toolbars?
#1
Hello Gintaras!

How can i reset toolbars from a function instead of using the menu?

Thank you.
#2
Close the toolbar and delete its registry value in key "Software\gindi\qm2\settings\toolbars". However this will not work in future QM versions, then post here again.
#3
Thank you.

Somehow here path is "Software\Gindi\QM2\Toolbars".

Best regards.
#4
Yes, my mistake.
#5
<deleted>
#6
Thanks again!
#7
In QM 2.4.0:
Macro Delete toolbar settings from DB
Code:
Copy      Help
int w=win("TOOLBAR1" "QM_toolbar"); if(w) clo w

_qmfile.SettingDelete("Toolbar1" "tb") ;;reset Toolbar1 in default layout
;or
_qmfile.SettingDelete("Toolbar1" "tb Layout Name") ;;reset Toolbar1 in another layout
;or
_qmfile.SettingDelete("Toolbar1" "tb*") ;;reset Toolbar1 in all layouts
#8
Hello Gintaras!

Great features in new version! Thank you for that.

Following code works. Just wondering if there is a shorter or better way.

Macro ResetTB
Code:
Copy      Help
QMITEM q; int i
rep
,;find toolbar functions
,i=qmitem(-i 1|2 &q 1)
,if(i=0) break
,if(q.itype!=3) continue

,;close open (multi)
,rep
,,int w=win(q.name "QM_toolbar" "" 2)
,,if(!w) break else clo w

,;delete setting
,_qmfile.SettingDelete(q.name "tb")


Best regards.
#9
Macro Macro2210
Code:
Copy      Help
CloseWindowsOf("" "QM_toolbar" "qm")
0.1 ;;wait because may close asynchronously

Sqlite& x=_qmfile.SqliteBegin
x.Exec("DELETE FROM xSett WHERE name GLOB 'tb*'")
;out __sqlite.sqlite3_changes(x)
_qmfile.SqliteEnd
Not better, just alternative.
#10
New to Sqlite. Can QM toolbar be excluded? Or restarted without qm restart?
#11
think this does it.

Macro ResetTB
Code:
Copy      Help
rget(_s "Toolbar" "\Tools" 0 "\System\Tools\QM toolbar")
if(_s.len) mac _s _hwndqm
#12
Can be excluded with Sqlite too, but it is easier with your code.

Macro restart toolbars
Code:
Copy      Help
;close all toolbars, and remember their names and owner windows

ARRAY(int) at ;;toolbar handles
ARRAY(int) aw ;;toolbar owner window handles
ARRAY(str) an ;;toolbar names
win "" "QM_toolbar" "qm" 0 "" at
aw.create(at.len); an.create(at.len)
int i
for i 0 at.len
,aw[i]=GetToolbarOwner(at[i])
,an[i].getwintext(at[i])
,clo at[i]


;create all toolbars
for i 0 an.len
,if(aw[i]) mac an[i] aw[i]; else mac an[i]
#13
Oh ok, i took it from init function.
#14
Sorry, it is correct, I forgot about it.
#15
Ok i can work with that! Again, thanks for the update and the fantastic new features.

Best regards.


Forum Jump:


Users browsing this thread: 4 Guest(s)