1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: Various utilities
4 // Author: David Webster
8 // Copyright: (c) David Webster
9 // Licence: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx.h".
13 #include "wx/wxprec.h"
19 #include "wx/cursor.h"
22 #include "wx/os2/private.h"
49 static const wxChar WX_SECTION
[] = _T("wxWindows");
50 static const wxChar eHOSTNAME
[] = _T("HostName");
51 static const wxChar eUSERID
[] = _T("UserId");
52 static const wxChar eUSERNAME
[] = _T("UserName");
54 // For the following functions we SHOULD fill in support
55 // for Windows-NT (which I don't know) as I assume it begin
56 // a POSIX Unix (so claims MS) that it has some special
57 // functions beyond those provided by WinSock
59 // Get full hostname (eg. DoDo.BSn-Germany.crg.de)
68 unsigned long ulLevel
= 0;
69 unsigned char* zBuffer
= NULL
;
70 unsigned long ulBuffer
= 256;
71 unsigned long* pulTotalAvail
= NULL
;
73 NetBios32GetInfo( (const unsigned char*)zServer
74 ,(const unsigned char*)zComputer
80 strcpy(zBuf
, zServer
);
83 const wxChar
* zDefaultHost
= _T("noname");
85 if ((zSysname
= wxGetenv(_T("SYSTEM_NAME"))) == NULL
)
87 ULONG n
= ::PrfQueryProfileString( HINI_PROFILE
96 wxStrncpy(zBuf
, zSysname
, nMaxSize
- 1);
97 zBuf
[nMaxSize
] = _T('\0');
99 return *zBuf
? TRUE
: FALSE
;
102 // Get user ID e.g. jacs
110 // UPM procs return 0 on success
111 lrc
= U32ELOCU((unsigned char*)zBuf
, (unsigned long *)&nType
);
112 if (lrc
== 0) return TRUE
;
127 wxStrncpy(zBuf
, _T("Unknown User"), nMaxSize
);
137 return((int)::DosKillProcess(0, (PID
)lPid
));
141 // Execute a program in an Interactive Shell
144 const wxString
& rCommand
147 wxChar
* zShell
= _T("CMD.EXE");
150 STARTDATA SData
= {0};
151 PSZ PgmTitle
= "Command Shell";
155 UCHAR achObjBuf
[256] = {0}; //error data if DosStart fails
158 SData
.Length
= sizeof(STARTDATA
);
159 SData
.Related
= SSF_RELATED_INDEPENDENT
;
160 SData
.FgBg
= SSF_FGBG_FORE
;
161 SData
.TraceOpt
= SSF_TRACEOPT_NONE
;
162 SData
.PgmTitle
= PgmTitle
;
163 SData
.PgmName
= zShell
;
165 sInputs
= "/C " + rCommand
;
166 SData
.PgmInputs
= (BYTE
*)sInputs
.c_str();
168 SData
.Environment
= 0;
169 SData
.InheritOpt
= SSF_INHERTOPT_SHELL
;
170 SData
.SessionType
= SSF_TYPE_WINDOWABLEVIO
;
173 SData
.PgmControl
= SSF_CONTROL_VISIBLE
| SSF_CONTROL_MAXIMIZE
;
176 SData
.InitXSize
= 200;
177 SData
.InitYSize
= 140;
179 SData
.ObjectBuffer
= (char*)achObjBuf
;
180 SData
.ObjectBuffLen
= (ULONG
)sizeof(achObjBuf
);
182 rc
= ::DosStartSession(&SData
, &ulSessID
, &vPid
);
183 if (rc
== 0 || rc
== 457) // NO_ERROR or SMG_START_IN_BACKGROUND
188 ::DosGetInfoBlocks(&ptib
, &ppib
);
190 ::DosWaitChild( DCWA_PROCESS
200 // Get free memory in bytes, or -1 if cannot determine amount (e.g. on UNIX)
201 long wxGetFreeMemory()
203 void* pMemptr
= NULL
;
208 lMemFlags
= PAG_FREE
;
209 rc
= ::DosQueryMem(pMemptr
, &lSize
, &lMemFlags
);
215 // ----------------------------------------------------------------------------
217 // ----------------------------------------------------------------------------
219 bool wxGetEnv(const wxString
& var
, wxString
*value
)
221 // wxGetenv is defined as getenv()
222 wxChar
*p
= wxGetenv(var
);
234 bool wxSetEnv(const wxString
& variable
, const wxChar
*value
)
236 #if defined(HAVE_SETENV)
237 return setenv(variable
.mb_str(), value
? wxString(value
).mb_str().data()
238 : NULL
, 1 /* overwrite */) == 0;
239 #elif defined(HAVE_PUTENV)
240 wxString s
= variable
;
242 s
<< _T('=') << value
;
245 const char *p
= s
.mb_str();
247 // the string will be free()d by libc
248 char *buf
= (char *)malloc(strlen(p
) + 1);
251 return putenv(buf
) == 0;
252 #else // no way to set an env var
258 // Sleep for nSecs seconds. Attempt a Windows implementation using timers.
259 static bool inTimer
= FALSE
;
261 class wxSleepTimer
: public wxTimer
271 static wxTimer
* wxTheSleepTimer
= NULL
;
274 unsigned long ulMilliseconds
277 ::DosSleep(ulMilliseconds
/1000l);
284 ::DosSleep(1000 * nSecs
);
287 // Consume all events until no more left
293 // Output a debug mess., in a system dependent fashion.
295 const wxChar
* zFmt
...
299 static wxChar zBuffer
[512];
301 if (!wxTheApp
->GetWantDebugOutput())
304 sprintf(zBuffer
, zFmt
, vAp
) ;
308 // Non-fatal error: pop up message box and (possibly) continue
311 , const wxString
& rTitle
314 wxBuffer
= new wxChar
[256];
315 wxSprintf(wxBuffer
, "%s\nContinue?", WXSTRINGCAST rMsg
);
316 if (::WinMessageBox( HWND_DESKTOP
319 ,(PSZ
)WXSTRINGCAST rTitle
321 ,MB_ICONEXCLAMATION
| MB_YESNO
327 // Fatal error: pop up message box and abort
330 , const wxString
& rTitle
335 ulRc
= ::WinMessageBox( HWND_DESKTOP
342 DosExit(EXIT_PROCESS
, ulRc
);
348 DosBeep(1000,1000); // 1kHz during 1 sec.
351 // Chris Breeze 27/5/98: revised WIN32 code to
352 // detect WindowsNT correctly
358 ULONG ulSysInfo
[QSV_MAX
] = {0};
361 ulrc
= ::DosQuerySysInfo( 1L
364 ,sizeof(ULONG
) * QSV_MAX
368 *pMajorVsn
= ulSysInfo
[QSV_VERSION_MAJOR
];
369 *pMajorVsn
= *pMajorVsn
/10;
370 *pMinorVsn
= ulSysInfo
[QSV_VERSION_MINOR
];
371 return wxWINDOWS_OS2
;
373 return wxWINDOWS
; // error if we get here, return generic value
376 // Reading and writing resources (eg WIN.INI, .Xdefaults)
378 bool wxWriteResource(
379 const wxString
& rSection
380 , const wxString
& rEntry
381 , const wxString
& rValue
382 , const wxString
& rFile
390 hIni
= ::PrfOpenProfile(hab
, (PSZ
)WXSTRINGCAST rFile
);
393 return (::PrfWriteProfileString( hIni
394 ,(PSZ
)WXSTRINGCAST rSection
395 ,(PSZ
)WXSTRINGCAST rEntry
396 ,(PSZ
)WXSTRINGCAST rValue
401 return (::PrfWriteProfileString( HINI_PROFILE
402 ,(PSZ
)WXSTRINGCAST rSection
403 ,(PSZ
)WXSTRINGCAST rEntry
404 ,(PSZ
)WXSTRINGCAST rValue
409 bool wxWriteResource(
410 const wxString
& rSection
411 , const wxString
& rEntry
413 , const wxString
& rFile
418 wxSprintf(zBuf
, "%.4f", fValue
);
419 return wxWriteResource( rSection
426 bool wxWriteResource(
427 const wxString
& rSection
428 , const wxString
& rEntry
430 , const wxString
& rFile
435 wxSprintf(zBuf
, "%ld", lValue
);
436 return wxWriteResource( rSection
443 bool wxWriteResource(
444 const wxString
& rSection
445 , const wxString
& rEntry
447 , const wxString
& rFile
452 wxSprintf(zBuf
, "%d", lValue
);
453 return wxWriteResource( rSection
461 const wxString
& rSection
462 , const wxString
& rEntry
464 , const wxString
& rFile
469 wxChar zDefunkt
[] = _T("$$default");
474 hIni
= ::PrfOpenProfile(hab
, (PSZ
)WXSTRINGCAST rFile
);
477 ULONG n
= ::PrfQueryProfileString( hIni
478 ,(PSZ
)WXSTRINGCAST rSection
479 ,(PSZ
)WXSTRINGCAST rEntry
486 if (n
== 0L || wxStrcmp(zBuf
, zDefunkt
) == 0)
495 ULONG n
= ::PrfQueryProfileString( HINI_PROFILE
496 ,(PSZ
)WXSTRINGCAST rSection
497 ,(PSZ
)WXSTRINGCAST rEntry
504 if (n
== 0L || wxStrcmp(zBuf
, zDefunkt
) == 0)
508 strcpy((char*)*ppValue
, zBuf
);
513 const wxString
& rSection
514 , const wxString
& rEntry
516 , const wxString
& rFile
521 zStr
= new wxChar
[1000];
522 bool bSucc
= wxGetResource( rSection
530 *pValue
= (float)wxStrtod(zStr
, NULL
);
542 const wxString
& rSection
543 , const wxString
& rEntry
545 , const wxString
& rFile
550 zStr
= new wxChar
[1000];
551 bool bSucc
= wxGetResource( rSection
559 *pValue
= wxStrtol(zStr
, NULL
, 10);
571 const wxString
& rSection
572 , const wxString
& rEntry
574 , const wxString
& rFile
579 zStr
= new wxChar
[1000];
580 bool bSucc
= wxGetResource( rSection
588 *pValue
= (int)wxStrtol(zStr
, NULL
, 10);
598 #endif // wxUSE_RESOURCES
600 // ---------------------------------------------------------------------------
601 // helper functions for showing a "busy" cursor
602 // ---------------------------------------------------------------------------
604 HCURSOR gs_wxBusyCursor
= 0; // new, busy cursor
605 HCURSOR gs_wxBusyCursorOld
= 0; // old cursor
606 static int gs_wxBusyCursorCount
= 0;
608 // Set the cursor to the busy cursor for all windows
609 void wxBeginBusyCursor(
613 if ( gs_wxBusyCursorCount
++ == 0 )
615 gs_wxBusyCursor
= (HCURSOR
)pCursor
->GetHCURSOR();
616 ::WinSetPointer(HWND_DESKTOP
, (HPOINTER
)gs_wxBusyCursor
);
618 //else: nothing to do, already set
621 // Restore cursor to normal
622 void wxEndBusyCursor()
624 wxCHECK_RET( gs_wxBusyCursorCount
> 0
625 ,_T("no matching wxBeginBusyCursor() for wxEndBusyCursor()")
628 if (--gs_wxBusyCursorCount
== 0)
630 ::WinSetPointer(HWND_DESKTOP
, (HPOINTER
)gs_wxBusyCursorOld
);
631 gs_wxBusyCursorOld
= 0;
635 // TRUE if we're between the above two calls
638 return (gs_wxBusyCursorCount
> 0);
641 // ---------------------------------------------------------------------------
642 const wxChar
* wxGetHomeDir(
646 wxString
& rStrDir
= *pStr
;
648 // OS/2 has no idea about home,
649 // so use the working directory instead?
651 // 256 was taken from os2def.h
653 # define MAX_PATH 256
659 ::DosQueryCurrentDir(0, zDirName
, &ulDirLen
);
661 return rStrDir
.c_str();
665 wxChar
* wxGetUserHome (
666 const wxString
& rUser
670 wxString
sUser1(rUser
);
672 wxBuffer
= new wxChar
[256];
674 if (sUser1
!= _T(""))
678 if (wxGetUserId( zTmp
679 ,sizeof(zTmp
)/sizeof(char)
682 // Guests belong in the temp dir
683 if (wxStricmp(zTmp
, _T("annonymous")) == 0)
685 if ((zHome
= wxGetenv(_T("TMP"))) != NULL
||
686 (zHome
= wxGetenv(_T("TMPDIR"))) != NULL
||
687 (zHome
= wxGetenv(_T("TEMP"))) != NULL
)
689 return *zHome
? zHome
: (wxChar
*)_T("\\");
691 if (wxStricmp(zTmp
, WXSTRINGCAST sUser1
) == 0)
696 if (sUser1
== _T(""))
698 if ((zHome
= wxGetenv(_T("HOME"))) != NULL
)
700 wxStrcpy(wxBuffer
, zHome
);
701 Unix2DosFilename(wxBuffer
);
702 wxStrcpy(zHome
, wxBuffer
);
708 return NULL
; // No home known!
711 // Check whether this window wants to process messages, e.g. Stop button
712 // in long calculations.
713 bool wxCheckForInterrupt(
721 HWND hwndFilter
= NULLHANDLE
;
722 HWND hwndWin
= (HWND
) pWnd
->GetHWND();
724 while(::WinPeekMsg(hab
, &vMsg
, hwndFilter
, 0, 0, PM_REMOVE
))
726 ::WinDispatchMsg(hab
, &vMsg
);
728 return TRUE
;//*** temporary?
732 wxFAIL_MSG(_T("pWnd==NULL !!!"));
733 return FALSE
;//*** temporary?
737 void wxGetMousePosition(
744 ::WinQueryPointerPos(HWND_DESKTOP
, &vPt
);
749 // Return TRUE if we have a colour display
750 bool wxColourDisplay()
756 hpsScreen
= ::WinGetScreenPS(HWND_DESKTOP
);
757 hdcScreen
= ::GpiQueryDevice(hpsScreen
);
758 ::DevQueryCaps(hdcScreen
, CAPS_COLORS
, 1L, &lColors
);
759 return(lColors
> 1L);
762 // Returns depth of screen
771 hpsScreen
= ::WinGetScreenPS(HWND_DESKTOP
);
772 hdcScreen
= ::GpiQueryDevice(hpsScreen
);
773 ::DevQueryCaps(hdcScreen
, CAPS_COLOR_PLANES
, 1L, &lPlanes
);
774 ::DevQueryCaps(hdcScreen
, CAPS_COLOR_BITCOUNT
, 1L, &lBitsPerPixel
);
776 nDepth
= (int)(lPlanes
* lBitsPerPixel
);
777 DevCloseDC(hdcScreen
);
781 // Get size of display
792 hpsScreen
= ::WinGetScreenPS(HWND_DESKTOP
);
793 hdcScreen
= ::GpiQueryDevice(hpsScreen
);
794 ::DevQueryCaps(hdcScreen
, CAPS_WIDTH
, 1L, &lWidth
);
795 ::DevQueryCaps(hdcScreen
, CAPS_HEIGHT
, 1L, &lHeight
);
796 DevCloseDC(hdcScreen
);
797 *pWidth
= (int)lWidth
;
798 *pHeight
= (int)lHeight
;
801 void wxDisplaySizeMM(
809 hpsScreen
= ::WinGetScreenPS(HWND_DESKTOP
);
810 hdcScreen
= ::GpiQueryDevice(hpsScreen
);
813 ::DevQueryCaps( hdcScreen
814 ,CAPS_HORIZONTAL_RESOLUTION
819 ::DevQueryCaps( hdcScreen
820 ,CAPS_VERTICAL_RESOLUTION
826 void wxClientDisplayRect(int *x
, int *y
, int *width
, int *height
)
828 // This is supposed to return desktop dimensions minus any window
829 // manager panels, menus, taskbars, etc. If there is a way to do that
830 // for this platform please fix this function, otherwise it defaults
831 // to the entire desktop.
834 wxDisplaySize(width
, height
);
842 return (::DosSetCurrentDir(WXSTRINGCAST rDir
));
845 // ---------------------------------------------------------------------------
846 // window information functions
847 // ---------------------------------------------------------------------------
849 wxString WXDLLEXPORT
wxGetWindowText(
854 long lLen
= ::WinQueryWindowTextLength((HWND
)hWnd
) + 1;
856 ::WinQueryWindowText((HWND
)hWnd
, lLen
, vStr
.GetWriteBuf((int)lLen
));
857 vStr
.UngetWriteBuf();
862 wxString WXDLLEXPORT
wxGetWindowClass(
867 int nLen
= 256; // some starting value
871 int nCount
= ::WinQueryClassName((HWND
)hWnd
, nLen
, vStr
.GetWriteBuf(nLen
));
873 vStr
.UngetWriteBuf();
876 // the class name might have been truncated, retry with larger
888 WXWORD WXDLLEXPORT
wxGetWindowId(
892 return ::WinQueryWindowUShort((HWND
)hWnd
, QWS_ID
);
895 wxString WXDLLEXPORT
wxPMErrorToStr(
902 // Remove the high order byte -- it is useless
904 vError
&= 0x0000ffff;
907 case PMERR_INVALID_HWND
:
908 sError
= wxT("Invalid window handle specified");
911 case PMERR_INVALID_FLAG
:
912 sError
= wxT("Invalid flag bit set");
915 case PMERR_NO_MSG_QUEUE
:
916 sError
= wxT("No message queue available");
919 case PMERR_INVALID_PARM
:
920 sError
= wxT("Parameter contained invalid data");
923 case PMERR_INVALID_PARAMETERS
:
924 sError
= wxT("Parameter value is out of range");
927 case PMERR_PARAMETER_OUT_OF_RANGE
:
928 sError
= wxT("Parameter value is out of range");
931 case PMERR_INVALID_INTEGER_ATOM
:
932 sError
= wxT("Not a valid atom");
935 case PMERR_INVALID_HATOMTBL
:
936 sError
= wxT("Atom table handle is invalid");
939 case PMERR_INVALID_ATOM_NAME
:
940 sError
= wxT("Not a valid atom name");
943 case PMERR_ATOM_NAME_NOT_FOUND
:
944 sError
= wxT("Valid name format, but cannot find name in atom table");
948 sError
= wxT("Unknown error");
951 } // end of wxPMErrorToStr
961 vPoint
[0].x
= rRect
.xLeft
;
962 vPoint
[0].y
= rRect
.yBottom
;
963 ::GpiMove(hPS
, &vPoint
[0]);
964 if (dwStyle
& wxSIMPLE_BORDER
||
965 dwStyle
& wxSTATIC_BORDER
)
967 vPoint
[1].x
= rRect
.xRight
- 1;
968 vPoint
[1].y
= rRect
.yTop
- 1;
976 if (dwStyle
& wxSUNKEN_BORDER
)
978 LINEBUNDLE vLineBundle
;
980 vLineBundle
.lColor
= 0x00FFFFFF; // WHITE
981 vLineBundle
.usMixMode
= FM_OVERPAINT
;
982 vLineBundle
.fxWidth
= 2;
983 vLineBundle
.lGeomWidth
= 2;
984 vLineBundle
.usType
= LINETYPE_SOLID
;
985 vLineBundle
.usEnd
= 0;
986 vLineBundle
.usJoin
= 0;
989 ,LBB_COLOR
| LBB_MIX_MODE
| LBB_WIDTH
| LBB_GEOM_WIDTH
| LBB_TYPE
993 vPoint
[1].x
= rRect
.xRight
- 1;
994 vPoint
[1].y
= rRect
.yTop
- 1;
1001 vPoint
[0].x
= rRect
.xLeft
+ 1;
1002 vPoint
[0].y
= rRect
.yBottom
+ 1;
1003 ::GpiMove(hPS
, &vPoint
[0]);
1004 vPoint
[1].x
= rRect
.xRight
- 2;
1005 vPoint
[1].y
= rRect
.yTop
- 2;
1013 vLineBundle
.lColor
= 0x00000000; // BLACK
1014 vLineBundle
.usMixMode
= FM_OVERPAINT
;
1015 vLineBundle
.fxWidth
= 2;
1016 vLineBundle
.lGeomWidth
= 2;
1017 vLineBundle
.usType
= LINETYPE_SOLID
;
1018 vLineBundle
.usEnd
= 0;
1019 vLineBundle
.usJoin
= 0;
1022 ,LBB_COLOR
| LBB_MIX_MODE
| LBB_WIDTH
| LBB_GEOM_WIDTH
| LBB_TYPE
1026 vPoint
[0].x
= rRect
.xLeft
+ 2;
1027 vPoint
[0].y
= rRect
.yBottom
+ 2;
1028 ::GpiMove(hPS
, &vPoint
[0]);
1029 vPoint
[1].x
= rRect
.xLeft
+ 2;
1030 vPoint
[1].y
= rRect
.yTop
- 3;
1031 ::GpiLine(hPS
, &vPoint
[1]);
1032 vPoint
[1].x
= rRect
.xRight
- 3;
1033 vPoint
[1].y
= rRect
.yTop
- 3;
1034 ::GpiLine(hPS
, &vPoint
[1]);
1036 vPoint
[0].x
= rRect
.xLeft
+ 3;
1037 vPoint
[0].y
= rRect
.yBottom
+ 3;
1038 ::GpiMove(hPS
, &vPoint
[0]);
1039 vPoint
[1].x
= rRect
.xLeft
+ 3;
1040 vPoint
[1].y
= rRect
.yTop
- 4;
1041 ::GpiLine(hPS
, &vPoint
[1]);
1042 vPoint
[1].x
= rRect
.xRight
- 4;
1043 vPoint
[1].y
= rRect
.yTop
- 4;
1044 ::GpiLine(hPS
, &vPoint
[1]);
1046 if (dwStyle
& wxDOUBLE_BORDER
)
1048 LINEBUNDLE vLineBundle
;
1050 vLineBundle
.lColor
= 0x00FFFFFF; // WHITE
1051 vLineBundle
.usMixMode
= FM_OVERPAINT
;
1052 vLineBundle
.fxWidth
= 2;
1053 vLineBundle
.lGeomWidth
= 2;
1054 vLineBundle
.usType
= LINETYPE_SOLID
;
1055 vLineBundle
.usEnd
= 0;
1056 vLineBundle
.usJoin
= 0;
1059 ,LBB_COLOR
| LBB_MIX_MODE
| LBB_WIDTH
| LBB_GEOM_WIDTH
| LBB_TYPE
1063 vPoint
[1].x
= rRect
.xRight
- 1;
1064 vPoint
[1].y
= rRect
.yTop
- 1;
1071 vLineBundle
.lColor
= 0x00000000; // WHITE
1072 vLineBundle
.usMixMode
= FM_OVERPAINT
;
1073 vLineBundle
.fxWidth
= 2;
1074 vLineBundle
.lGeomWidth
= 2;
1075 vLineBundle
.usType
= LINETYPE_SOLID
;
1076 vLineBundle
.usEnd
= 0;
1077 vLineBundle
.usJoin
= 0;
1080 ,LBB_COLOR
| LBB_MIX_MODE
| LBB_WIDTH
| LBB_GEOM_WIDTH
| LBB_TYPE
1084 vPoint
[0].x
= rRect
.xLeft
+ 2;
1085 vPoint
[0].y
= rRect
.yBottom
+ 2;
1086 ::GpiMove(hPS
, &vPoint
[0]);
1087 vPoint
[1].x
= rRect
.xRight
- 2;
1088 vPoint
[1].y
= rRect
.yTop
- 2;
1095 vLineBundle
.lColor
= 0x00FFFFFF; // BLACK
1096 vLineBundle
.usMixMode
= FM_OVERPAINT
;
1097 vLineBundle
.fxWidth
= 2;
1098 vLineBundle
.lGeomWidth
= 2;
1099 vLineBundle
.usType
= LINETYPE_SOLID
;
1100 vLineBundle
.usEnd
= 0;
1101 vLineBundle
.usJoin
= 0;
1104 ,LBB_COLOR
| LBB_MIX_MODE
| LBB_WIDTH
| LBB_GEOM_WIDTH
| LBB_TYPE
1108 vPoint
[0].x
= rRect
.xLeft
+ 3;
1109 vPoint
[0].y
= rRect
.yBottom
+ 3;
1110 ::GpiMove(hPS
, &vPoint
[0]);
1111 vPoint
[1].x
= rRect
.xRight
- 3;
1112 vPoint
[1].y
= rRect
.yTop
- 3;
1120 if (dwStyle
& wxRAISED_BORDER
)
1122 LINEBUNDLE vLineBundle
;
1124 vLineBundle
.lColor
= 0x00000000; // BLACK
1125 vLineBundle
.usMixMode
= FM_OVERPAINT
;
1126 vLineBundle
.fxWidth
= 2;
1127 vLineBundle
.lGeomWidth
= 2;
1128 vLineBundle
.usType
= LINETYPE_SOLID
;
1129 vLineBundle
.usEnd
= 0;
1130 vLineBundle
.usJoin
= 0;
1133 ,LBB_COLOR
| LBB_MIX_MODE
| LBB_WIDTH
| LBB_GEOM_WIDTH
| LBB_TYPE
1137 vPoint
[1].x
= rRect
.xRight
- 1;
1138 vPoint
[1].y
= rRect
.yTop
- 1;
1145 vPoint
[0].x
= rRect
.xLeft
+ 1;
1146 vPoint
[0].y
= rRect
.yBottom
+ 1;
1147 ::GpiMove(hPS
, &vPoint
[0]);
1148 vPoint
[1].x
= rRect
.xRight
- 2;
1149 vPoint
[1].y
= rRect
.yTop
- 2;
1157 vLineBundle
.lColor
= 0x00FFFFFF; // WHITE
1158 vLineBundle
.usMixMode
= FM_OVERPAINT
;
1159 vLineBundle
.fxWidth
= 2;
1160 vLineBundle
.lGeomWidth
= 2;
1161 vLineBundle
.usType
= LINETYPE_SOLID
;
1162 vLineBundle
.usEnd
= 0;
1163 vLineBundle
.usJoin
= 0;
1166 ,LBB_COLOR
| LBB_MIX_MODE
| LBB_WIDTH
| LBB_GEOM_WIDTH
| LBB_TYPE
1170 vPoint
[0].x
= rRect
.xLeft
+ 2;
1171 vPoint
[0].y
= rRect
.yBottom
+ 2;
1172 ::GpiMove(hPS
, &vPoint
[0]);
1173 vPoint
[1].x
= rRect
.xLeft
+ 2;
1174 vPoint
[1].y
= rRect
.yTop
- 3;
1175 ::GpiLine(hPS
, &vPoint
[1]);
1176 vPoint
[1].x
= rRect
.xRight
- 3;
1177 vPoint
[1].y
= rRect
.yTop
- 3;
1178 ::GpiLine(hPS
, &vPoint
[1]);
1180 vPoint
[0].x
= rRect
.xLeft
+ 3;
1181 vPoint
[0].y
= rRect
.yBottom
+ 3;
1182 ::GpiMove(hPS
, &vPoint
[0]);
1183 vPoint
[1].x
= rRect
.xLeft
+ 3;
1184 vPoint
[1].y
= rRect
.yTop
- 4;
1185 ::GpiLine(hPS
, &vPoint
[1]);
1186 vPoint
[1].x
= rRect
.xRight
- 4;
1187 vPoint
[1].y
= rRect
.yTop
- 4;
1188 ::GpiLine(hPS
, &vPoint
[1]);
1190 } // end of wxDrawBorder