Jump to content

Code Snippets and Tips: Difference between revisions

From EDM2
No edit summary
Ak120 (talk | contribs)
mNo edit summary
 
Line 1: Line 1:
; [http://www.edm2.com/common/snippets/display.txt Code to display messages to the screen in PM.]
; [http://www.edm2.com/common/snippets/display.txt Code to display messages to the screen in PM.]: (Larry Salomon Jr.) 1-05
: (Larry Salomon Jr.) 1-05
; [http://www.edm2.com/common/snippets/save_restore_winpos.txt save_restore_winpos.txt Save and restore window positions.]: (Mark Harrison) 1-06
; [http://www.edm2.com/common/snippets/save_restore_winpos.txt save_restore_winpos.txt Save and restore window positions.]  
; [http://www.edm2.com/common/snippets/splitfilename.txt Split a fully qualified file name into its components.]: (Larry Salomon Jr.) 1-07
: (Mark Harrison) 1-06
; [http://www.edm2.com/common/snippets/notebooktabs.txt Code to size major notebook tabs according to text length]: (Larry Salomon Jr.) 2-04
; [http://www.edm2.com/common/snippets/splitfilename.txt Split a fully qualified file name into its components.]
; [http://www.edm2.com/common/snippets/numlock1.txt Numlock]: lafaix@ibm.net (Martin Lafaix) 5-02
: (Larry Salomon Jr.) 1-07
; [http://www.edm2.com/common/snippets/numlock2.txt Numlock]: neridan@central.co.nz (Neil Daniell) 5-02
; [http://www.edm2.com/common/snippets/notebooktabs.txt Code to size major notebook tabs according to text length]
; [http://www.edm2.com/common/snippets/numlock3.txt Numlock]: wilan01@ingres.com 5-02
: (Larry Salomon Jr.) 2-04
; [http://www.edm2.com/common/snippets/numlock1.txt Numlock]
: lafaix@ibm.net (Martin Lafaix) 5-02<br />


; [http://www.edm2.com/common/snippets/numlock2.txt Numlock]
; [http://www.edm2.com/common/snippets/numlock4.txt Numlock]: rhasty@dialnet.net 5-02
: neridan@central.co.nz (Neil Daniell) 5-02<br />
; [http://www.edm2.com/common/snippets/newc2.zip Hook code to circumvent built-in methods of OS/2]: pfitz@echo-on.net (Peter Fitzsimmons) 5-03
 
; [http://www.edm2.com/common/snippets/3270.txt Code to emulate TN3270 for new PC/3270 users.]: lionel.b.dyck@kp.org (Lionel B. Dyck) 5-04
; [http://www.edm2.com/common/snippets/numlock3.txt Numlock]
; [http://www.edm2.com/common/snippets/pipes.txt A simple Telnet with pipes.]: oobles@loose.apana.org.au (David Ryan) 5-05
: wilan01@ingres.com 5-02<br />
; [http://www.edm2.com/common/snippets/ezapp.zip EZapp]: jim@www.vwm.com (Jim Louvau) 5-11
 
:Jim Louvau: "Ezapp.zip has the skeleton that I use for "down & dirty" applets and small/trivial applications. It's a typical "dialog box as a frame window" affair, the major exception being that virtually nobody mentions (knows?) that you can attach a program icon, main-menu and an accelerator table to the thing. In effect, you can create a &quot;real&quot; main window using a dialog template in a resource file (with the added benefit of not having to hand-load and position any controls you might have wanted)."
; [http://www.edm2.com/common/snippets/numlock4.txt Numlock]
; [http://www.edm2.com/common/snippets/ezframe.zip EZframe]: jim@www.vwm.com (Jim Louvau) 5-12
: rhasty@dialnet.net 5-02
:EZFrame.zip is much the same as above, except that it demos defining an honest-to-God frame window in a resource file. This is buried under the "FRAME" control keyword in the resource file documentation, but isn't explained or "exampled" for squat. Basically you define the frame, define the child window within it, and load the whole mess with WinLoadDlg() (which of course, will add your controls in the appropriate places in the child window). In this case, you end up with the real McCoy, not a dialog window, but you get to define your main window with a dialog editor, instead of screwing around with WinCreate*() and manually hassling with controls. I've found that damn near nobody knows you can do this :-)
; [http://www.edm2.com/common/snippets/newc2.zip Hook code to circumvent built-in methods of OS/2]
;[http://www.edm2.com/common/snippets/pmtools.zip PMTools]: jim@www.vwm.com (Jim Louvau) 6-01
: pfitz@echo-on.net (Peter Fitzsimmons) 5-03
:PMTools.zip has a whole slug of trivial yet handy snippets in it that I seem to always be using in my code, from a window centering (not just on the desktop, but within a parent also) function, to code that prevents loading a second instance of an application (and will optionally switch focus to the running copy if one exists), and a function for loading and associating a help file/instance.
; [http://www.edm2.com/common/snippets/3270.txt Code to emulate TN3270 for new PC/3270 users.]
;[http://www.edm2.com/common/snippets/pcbar.c Painting a percent bar]: peter.koller@wanadoo.fr (Peter Koller) 6-02
: lionel.b.dyck@kp.org (Lionel B. Dyck) 5-04
;[http://www.edm2.com/common/snippets/reboot.txt Rebooting OS/2]: rplyler@raleigh.ibm.com (Bob Plyler) 6-05
; [http://www.edm2.com/common/snippets/pipes.txt A simple Telnet with pipes.]
;[http://www.edm2.com/common/snippets/dialog.zip Painting a Dialog]: jscott@us.ibm.com (James Scott, Jr.) 6-06
: oobles@loose.apana.org.au (David Ryan) 5-05
:This package provides basic services needed to use dialog controls on a regular PM Client window.
; [http://www.edm2.com/common/snippets/ezapp.zip EZapp]
: jim@www.vwm.com (Jim Louvau) 5-11<br />
Jim Louvau: &quot;Ezapp.zip has the skeleton that I use for &quot;down &amp; dirty&quot; applets and small/trivial applications. It's a typical &quot;dialog box as a frame window&quot; affair, the major exception being that virtually nobody mentions (knows?) that you can attach a program icon, main-menu and an accelerator table to the thing. In effect, you can create a &quot;real&quot; main window using a dialog template in a resource file (with the added benefit of not having to hand-load and position any controls you might have wanted).&quot;
; [http://www.edm2.com/common/snippets/ezframe.zip EZframe]
: jim@www.vwm.com (Jim Louvau) 5-12<br />
EZFrame.zip is much the same as above, except that it demos defining an honest-to-God frame window in a resource file. This is buried under the &quot;FRAME&quot; control keyword in the resource file documentation, but isn't explained or &quot;exampled&quot; for squat. Basically you define the frame, define the child window within it, and load the whole mess with WinLoadDlg() (which of course, will add your controls in the appropriate places in the child window). In this case, you end up with the real McCoy, not a dialog window, but you get to define your main window with a dialog editor, instead of screwing around with WinCreate*() and manually hassling with controls. I've found that damn near nobody knows you can do this :-)
; [http://www.edm2.com/common/snippets/pmtools.zip PMTools]
: jim@www.vwm.com (Jim Louvau) 6-01<br />
PMTools.zip has a whole slug of trivial yet handy snippets in it that I seem to always be using in my code, from a window centering (not just on the desktop, but within a parent also) function, to code that prevents loading a second instance of an application (and will optionally switch focus to the running copy if one exists), and a function for loading and associating a help file/instance.
; [http://www.edm2.com/common/snippets/pcbar.c Painting a percent bar]
: peter.koller@wanadoo.fr (Peter Koller) 6-02<br />
 
; [http://www.edm2.com/common/snippets/reboot.txt Rebooting OS/2]
: rplyler@raleigh.ibm.com (Bob Plyler) 6-05<br />
 
; [http://www.edm2.com/common/snippets/dialog.zip Painting a Dialog]
: jscott@us.ibm.com (James Scott, Jr.) 6-06<br />
This package provides basic services needed to use dialog controls on a regular PM Client window.

Latest revision as of 09:02, 7 December 2020

Code to display messages to the screen in PM.
(Larry Salomon Jr.) 1-05
save_restore_winpos.txt Save and restore window positions.
(Mark Harrison) 1-06
Split a fully qualified file name into its components.
(Larry Salomon Jr.) 1-07
Code to size major notebook tabs according to text length
(Larry Salomon Jr.) 2-04
Numlock
lafaix@ibm.net (Martin Lafaix) 5-02
Numlock
neridan@central.co.nz (Neil Daniell) 5-02
Numlock
wilan01@ingres.com 5-02
Numlock
rhasty@dialnet.net 5-02
Hook code to circumvent built-in methods of OS/2
pfitz@echo-on.net (Peter Fitzsimmons) 5-03
Code to emulate TN3270 for new PC/3270 users.
lionel.b.dyck@kp.org (Lionel B. Dyck) 5-04
A simple Telnet with pipes.
oobles@loose.apana.org.au (David Ryan) 5-05
EZapp
jim@www.vwm.com (Jim Louvau) 5-11
Jim Louvau: "Ezapp.zip has the skeleton that I use for "down & dirty" applets and small/trivial applications. It's a typical "dialog box as a frame window" affair, the major exception being that virtually nobody mentions (knows?) that you can attach a program icon, main-menu and an accelerator table to the thing. In effect, you can create a "real" main window using a dialog template in a resource file (with the added benefit of not having to hand-load and position any controls you might have wanted)."
EZframe
jim@www.vwm.com (Jim Louvau) 5-12
EZFrame.zip is much the same as above, except that it demos defining an honest-to-God frame window in a resource file. This is buried under the "FRAME" control keyword in the resource file documentation, but isn't explained or "exampled" for squat. Basically you define the frame, define the child window within it, and load the whole mess with WinLoadDlg() (which of course, will add your controls in the appropriate places in the child window). In this case, you end up with the real McCoy, not a dialog window, but you get to define your main window with a dialog editor, instead of screwing around with WinCreate*() and manually hassling with controls. I've found that damn near nobody knows you can do this :-)
PMTools
jim@www.vwm.com (Jim Louvau) 6-01
PMTools.zip has a whole slug of trivial yet handy snippets in it that I seem to always be using in my code, from a window centering (not just on the desktop, but within a parent also) function, to code that prevents loading a second instance of an application (and will optionally switch focus to the running copy if one exists), and a function for loading and associating a help file/instance.
Painting a percent bar
peter.koller@wanadoo.fr (Peter Koller) 6-02
Rebooting OS/2
rplyler@raleigh.ibm.com (Bob Plyler) 6-05
Painting a Dialog
jscott@us.ibm.com (James Scott, Jr.) 6-06
This package provides basic services needed to use dialog controls on a regular PM Client window.