1. Re: Hotkey Toolbar Quick Program Launcher - my first Euphoria prog=ram

Ray,

Even the attachments have the extra "formatting"(?) characters in them, eg:
sequence assign, button
assign =3D repeat("",39)
button =3D repeat(0,39)

Dan Moyer

----- Original Message -----
From: "Ray Tomes" <rtomes at ihug.co.nz>
To: "EUforum" <EUforum at topica.com>
Subject: Re: Hotkey Toolbar Quick Program Launcher - my first Euphoria
prog=ram


> Hi Dan and All
>
> Well I have done as you suggested and used attachments.
> I prefer not to use them in a group but I don't want to have any more
> big trashed posts or I will become a major nuisance in the group.
>
> You can change quick.ini to have what you want to launch, and
> quick.exw will need to have the correct location of quick.ini
> in it (at present c:\euphoria\bin\).
>
> Please let me know what you think and if you have any answers to
> my questions in the previous post.
>
> Thanks
>
> Ray
>


----------------------------------------------------------------------------
----


> sequence qhelp
> qhelp=3D"QUICK is a quick hotkey program launcher of your favourites\n" &
>   "\n" &
>   "START *quick* application which will be in minimized mode.\n" &
>   "At any time press F12 to bring quick up for use,\n" &
>   "then either click on a button or type a single key \n" &
>   "a-z (or A-Z) or 0-9 to run the chosen application.\n" &
>   "To remember easily, I use E for Explorer, I for Irfanview,\n" &
>   "W for WordPad, Z for WinZip etc.\n" &
>   "Press Enter to alter any of the 36 chosen applications.\n" &
>   "The application's icon will show on the button it is set to.\n" &
>   "Press Esc and the application will be disabled and closed.\n" &
>   "Press any other key and help information will be brought up.\n" &
>   "Be Happy!\n" &
>   "\n" &
>   "=A9 Copyright 2003 Ray Tomes -- rtomes at ihug.co.nz\n" &
>   "No warranty of any kind is given by the author\n" &
>   "as it is my first Euphoria program, but I did test it lots  blink\n" &
>   "May be freely used.  Please advise suggested changes to me.\n" &
>   "Written in Euphoria language, see http://www.RapidEuphoria.com\n" &
>   "and uses Win32Lib by David Cuny and friends and hotkey by Ting.\n" &
>   "Thanks to Dan Moyer, Derek Parnell, C.K.Lester, aku saya,\n" &
>   "Pete Lomax and others for help with Euphoria and Win32Lib.\n"
>
> without warning
> include Win32lib.ew
> include hotkey.e
> include msgbox.e
>
> object bshow
> bshow =3D "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789" & {"Enter","Esc","?"}
> atom bnum -- button number pressed or key typed: a-z=3D>1-26,
0-9=3D>27-36,=
>
> --           Enter=3D>37, Esc=3D>38, other=3D>39
> sequence assign, button
> assign =3D repeat("",39)
> button =3D repeat(0,39)
> atom inifn, i
> object linb, bsh, bhint
> constant Window1=3Dcreate(Window,"Quick",0,Center,Center,128,547,0)
>
> atom Window2
>
> procedure gethelp()
>   i =3D message_box(qhelp, "Quick HELP", MB_OK)
> end procedure
>
> procedure reassign()
>   -- to be done yet
> end procedure
>
> procedure launch(integer butno)
>   if butno=3D37 then reassign()
>   elsif butno=3D38 then closeApp()
>   elsif butno=3D39 then gethelp()
>   else shellExecute("open", assign[butno], SW_SHOWNORMAL)
>   end if
>   openWindow(Window1, Minimize)
> end procedure
>
> procedure AnyKey(integer self, integer event, sequence params)
>   integer keycode, shift
>   keycode=3Dparams[1]
>   shift=3Dparams[2]
>   if keycode>=3D'a' and keycode<=3D'z' then bnum=3Dkeycode-96
>   elsif keycode>=3D'A' and keycode<=3D'Z' then bnum=3Dkeycode-64
>   elsif keycode>=3D'0' and keycode<=3D'9' then bnum=3Dkeycode-48+27
>   elsif keycode=3D13 then bnum=3D37
>   elsif keycode=3D27 then bnum=3D38
>   else bnum=3D39 -- undefined keys also gives help
>   end if
>   launch(bnum)
> end procedure
>
> procedure WinHotKey(atom id) -- HotKey pressed =3D> show window
>   openWindow( Window1, Normal)
> end procedure
>
> procedure ClickBut(integer id, integer event, sequence parms)
>   for ib=3D1 to 39 do
>     if id=3Dbutton[ib] then launch(ib) end if
>   end for
> end procedure
>
> -- serious execution starts here with quick.ini file
> -- originally I just had "quick.ini" but rebooting req'd change ???
> inifn=3Dopen( "C:\\EUPHORIA\\BIN\\quick.ini", "r")
> if inifn =3D -1 then
>   i =3D message_box("quick.ini file not found", "Quick", MB_OKCANCEL)
> else
>   linb =3D gets(inifn)
>   if equal(linb,"[buttons]\n") then
>     for bn=3D1 to 36 do
>       linb =3D gets(inifn)
>       if atom(linb) then exit end if
>       assign[bn]=3Dlinb[3..length(linb)-1]
>     end for
>   end if
> end if
> close(inifn)
>
> for ib=3D1 to 39 do
>   i=3D0
>   bsh=3Dbshow[ib]
>   if ib<37 then bhint=3Dbsh&" unassigned"
>   elsif ib=3D37 then bhint=3D"Enter sets code assignment of applications"
>   elsif ib=3D38 then bhint=3D"Esc shuts down *quick*"
>   elsif ib=3D39 then bhint=3D"? or space for Help and About quick"
>   end if
>   if length(assign[ib])>2 then bhint=3Dbsh&" launches "&assign[ib] end if
>   if atom(bsh) then bsh=3D{bsh} end if
> ----- it seems that extractIcon is NOT compatible with PictureButton
> --  if match(".exe",assign[ib]) then
> --    i=3DextractIcon(assign[ib])
> --    if i!=3D0 then button[ib]=3Dcreate(PictureButton,{bsh,bhint},
> --      Window1,floor((ib-1)/13)*40, remainder(ib-1,13)*40, 40, 40, 0)
> --      setIcon ( button[ib], {i} )
> --    else
> --    end if
> --  end if
>   if i=3D0 then
>     button[ib]=3Dcreate(PushButton,{bsh,bhint},
>       Window1,floor((ib-1)/13)*40,remainder(ib-1,13)*40,40,40,0)
>   end if
>   setHandler( button[ib], w32HClick, routine_id("ClickBut"))
> end for
>
> onHotKey =3D routine_id("WinHotKey")
> setHotKey( Window1, 2, 0, VK_F12)
> setHandler( Window1, w32HKeyPress, routine_id("AnyKey"))
> WinMain( Window1, Minimize )
>
<snip>


----------------------------------------------------------------------------
----


> [buttons]
> A=3D
> B=3D
> C=3D
> D=3DC:\EUPHORIA\DOC\database.doc
> E=3DC:\WINDOWS\EXPLORER.EXE
> F=3D
> G=3D
> H=3DC:\EUPHORIA\DOC\ENCYEU.HLP
> I=3D"C:\Program Files\IrfanView\i_view32.exe"
> J=3D
> K=3D
> L=3D"C:\Program Files\NoteTab Light\NoteTab.exe"
> M=3D
> N=3D"C:\Program Files\Netscape\Netscape\Netscp.exe"
> O=3D
> P=3D
> Q=3D
> R=3DC:\EUPHORIA\DOC\REFMAN.DOC
> S=3D
> T=3D
> U=3D
> V=3D
> W=3D"C:\Program Files\Accessories\WORDPAD.EXE"
> X=3D
> Y=3D
> Z=3D"C:\Program Files\WinZip\WINZIP32.EXE"
> 0=3D
> 1=3D
> 2=3DC:\EUPHORIA\DL\IDE\IDE.exw
> 3=3DC:\EUPHORIA\DL\Win32Lib\Docs\index.htm
> 4=3D
> 5=3D
> 6=3D
> 7=3D
> 8=3D
> 9=3D
>
>

new topic     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu