Thread View: comp.os.os2.programmer
5 messages
5 total messages
Started by oleg
Thu, 02 Aug 1990 13:54
RE: OS/2 Network APIs
Author: oleg
Date: Thu, 02 Aug 1990 13:54
Date: Thu, 02 Aug 1990 13:54
8 lines
692 bytes
692 bytes
The three vendors that sell TCP/IP products for OS/2 are IBM, FTP Software, and Essex systems. Last month PC WEEK had an article comparing them. FTP Software provides sockets. IBM APIs include sockets, RPC, NCS, and KERBEROS. Not sure about Essex but most likely they do, too. Oleg Vishnepolsky IBM T. J. Watson Research Center
HELP!!! OWNERDRAW hItem
Author: The Karate Kid
Date: Fri, 03 Aug 1990 16:13
Date: Fri, 03 Aug 1990 16:13
18 lines
1338 bytes
1338 bytes
Let the gods be favorable and someone answer my plea... I have a LS_OWNERDRAW styled list box and have yet to figure out the method of drawing text in response to the WM_DRAWITEM message for this listbox. The books don't help at all. The only clue is that the hItem part of the OWNERITEM structure "specifies an application-defined item handle" (pg 512 of Volume 2, Micorsoft OS/2 Programmer's Ref.) I've tried to pass a pointer to a string, pointer to a structure that contains a string but to no avail. Has anyone had success in this quandry? I just want to know what to pass as the mp2 of the LM_INSERTITEM message. Thanks in advance. Marc Paige ---------------------------------------------------------------------------- "tired and shagged out from a prolonged squawk" - mpfc the parrot sketch
Re: HELP!!! OWNERDRAW hItem
Author: ie15
Date: Sat, 01 Sep 1990 13:42
Date: Sat, 01 Sep 1990 13:42
20 lines
1430 bytes
1430 bytes
In article <953@metapyr.UUCP>, marc@metapyr.UUCP ( The Karate Kid ) writes: > > I have a LS_OWNERDRAW styled list box and have yet to figure out the > method of drawing text in response to the WM_DRAWITEM message for this > listbox. The books don't help at all. The only clue is that the hItem > part of the OWNERITEM structure "specifies an application-defined item > handle" (pg 512 of Volume 2, Micorsoft OS/2 Programmer's Ref.) I've tried > to pass a pointer to a string, pointer to a structure that contains a string > but to no avail. Has anyone had success in this quandry? I just want to > know what to pass as the mp2 of the LM_INSERTITEM message. > I haven't an answer since I've yet to work own owner draw stuff yet. However, the IBM Programmer's Toolkt has a great example of an ownerdraw listbox in the sample program that shows Extended Attributes. The filepath is: x:\toolkt12\c\samples\bse\ealist\ealist.c If you hack thru it long enough you should be able to figure out what you need. Ken Tabor University of Noth Texas
Re: HELP!!! OWNERDRAW hItem
Author: Col. Ames and Pixel
Date: Sat, 01 Sep 1990 20:10
Date: Sat, 01 Sep 1990 20:10
60 lines
2669 bytes
2669 bytes
HAHAHAHAHAHA!!! A OS/2 question I can answer.
I played for many moons with OWNERDRAW. Currently I am not at my friends
OS/2 box so I can look at the code. All of this is from memory.
First:
You need to send a LM_SETITEMHEIGHT to the LB to set the height of your
text (I use lEmHeight in the FONTMETRICS structure)
When you send text to a LB the iItem is the way to get at THAT piece of
text. Send a LM_QUERYITEMTEXT using the iItem you get out of the OWNERITEM
structure to the list box to get the text (That wasn't rendered b'cause of the
LS_OWNERDRAW attribute) that the LM_DRAWITEM sends you.
Next set up the fonts in the Presentation Space. Clear the PS then use the
rclItem.x and .y in a GpiCharStringAt() to place the text.
REMEMBER!!!!!!
1) You have to deal with a WM_INITDLG when there is nothing in the box.
2) You have to deal with the fsState and fsStateOld flags.
a) One condidtion means DRAWME.
b) One means HILITE me.
c) One means UNHILITE me
e) SET the flag to let the system know you HAVE done the "right thing".
If you dont the system will do it for you and the LB will redraw itself
a few times. (This is annoying during developement)
3) You will violate the 1/10 of sec rule, if you dont spawn a thread (At LEAST
when you get a WM_INITDLG.)
A few gotchas:
1) FATTR_HILITE (or what ever it is ) doesn't seem to work. Use GpiSetColor and
GpiSetBackColor before you clear the PS.
2) Until you implement ALL fsState/fsStateOld logic, the system will redraw
the list box in its own way, thus selecting and unselecting will be ugly.
I hope this helps. I used it to do multi-column justified text in a LB. LB's
dont have settable fonts and don't KNOW tabs (Hint to the OS/2 developement
people at IBM.) I will post source when I get a chance to, but there is NO
OS/2 term prg that will work with EMACS (If you know of a free/share one let
me know)
adam hill ...
--
***************************************************************************
adam hill Some Words Of .wisdom:
Re: OWNERDRAW hItem/Changing control window's output
Author: ie15
Date: Sun, 02 Sep 1990 11:50
Date: Sun, 02 Sep 1990 11:50
31 lines
1602 bytes
1602 bytes
Hey Adam, List boxes do have settable fonts. So do most all PM controls now in 1.2 Using WinSetPresParams() you can tell a control to set his colors as well as his font. for example HWND hControl; ULONG color; CHAR font[20]; hControl =WinWindowFromID( hwnd, LB_ITEMS); /* Assuming a window with a listbox with an ID of LB_ITEMS */ strcpy( font, "12.Courier"); WinSetPresParams( hC, PP_FONTNAMESIZE, sizeof( font), font); This is a cheap way to get the columns of a listbox to line up, but hey. color =CLR_YELLOW; WinSetPresParams( hC, PP_FOREGROUNDCOLORINDEX, sizeof( ULONG), &color); color =CLR_BLUE; WinSetPresParams( hC, PP_BACKGROUNDCOLORINDEX, sizeof( ULONG), &color); This will change the listbox to do all its output in yellow on blue. Pretty useful. But remember, the user changed his system colors with the control panel. We should use these APIs with a clear head and proper judgement else we fall prey to congression regulators regulating our user-interface code. Ken Tabor University of North Texas
Thread Navigation
This is a paginated view of messages in the thread with full content displayed inline.
Messages are displayed in chronological order, with the original post highlighted in green.
Use pagination controls to navigate through all messages in large threads.
Back to All Threads