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

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

Thank you.
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.
Thank you.

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

Best regards.
Yes, my mistake.
Thanks again!
In QM 2.4.0:
Macro Delete toolbar settings from DB
Copy      Help
int w=win("TOOLBAR1" "QM_toolbar"); if(w) clo w

_qmfile.SettingDelete("Toolbar1" "tb") ;;reset Toolbar1 in default layout
_qmfile.SettingDelete("Toolbar1" "tb Layout Name") ;;reset Toolbar1 in another layout
_qmfile.SettingDelete("Toolbar1" "tb*") ;;reset Toolbar1 in all layouts
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
Copy      Help
QMITEM q; int i
,;find toolbar functions
,i=qmitem(-i 1|2 &q 1)
,if(i=0) break
,if(q.itype!=3) continue

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

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

Best regards.
Macro Macro2210
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)
Not better, just alternative.
New to Sqlite. Can QM toolbar be excluded? Or restarted without qm restart?
think this does it.

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

Macro restart toolbars
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
,clo at[i]

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

Best regards.

Forum Jump:

Users browsing this thread: 1 Guest(s)