home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 5 Edit
/
05-Edit.zip
/
epmsmp.zip
/
LOADTB.E
< prev
next >
Wrap
Text File
|
1995-10-09
|
2KB
|
59 lines
; Command to load a previously-saved toolbar, by Larry Margolis
compile if not defined(EPMINFO_EDITFRAME)
include 'stdconst.e'
compile endif
compile if not EPM32
*** Error: EPM 6 or above required for Toolbar support.
compile endif
compile if not defined(ERROR__MSG)
include 'english.e'
compile endif
const
NO_TOOLBARS__MSG = 'No saved toolbars from which to select.'
LOAD_TOOLBAR__MSG = 'Load Toolbar' -- Dialog box title
SELECT_TOOLBAR__MSG = 'Select a Toolbar menu set'
TOOLBAR_UNKNOWN__MSG = 'Toolbar unknown: '
defc load_toolbar
universal app_hini, toolbar_loaded
TB_name = arg(1)
if TB_name='' then -- List all toolbars
inidata = queryprofile(app_hini, INI_UCMENU_APP, '')
if not length(inidata) then sayerror NO_TOOLBARS__MSG; return; endif
getfileid startfid
'xcom e /c /q tempfile'
if rc<>-282 then -- sayerror('New file')
sayerror ERROR__MSG rc BAD_TMP_FILE__MSG sayerrortext(rc)
return
endif
.autosave = 0
browse_mode = browse() -- query current state
if browse_mode then call browse(0); endif
do while inidata<>''
parse value inidata with menuname \0 inidata
insertline menuname, .last+1
enddo
if browse_mode then call browse(1); endif -- restore browse state
if listbox_buffer_from_file(startfid, bufhndl, noflines, usedsize) then return; endif
parse value listbox(LOAD_TOOLBAR__MSG, \0 || atol(usedsize) || atoi(32) || atoi(bufhndl),
'/'OK__MSG'/'Cancel__MSG'/'Help__MSG,1,5,min(noflines,12),0,
gethwndc(APP_HANDLE) || atoi(1) || atoi(1) || atoi(7000) ||
SELECT_TOOLBAR__MSG) with button 2 TB_name \0
call buffer(FREEBUF, bufhndl)
if button<>\1 then return; endif
else
inidata = queryprofile(app_hini, INI_UCMENU_APP, TB_name)
if inidata = '' then
sayerror TOOLBAR_UNKNOWN__MSG || TB_name
return
endif
endif
call windowmessage(0, getpminfo(EPMINFO_EDITFRAME), 5916, app_hini, put_in_buffer(TB_name))
toolbar_loaded = menuname