|
Post by Rod on Aug 17, 2022 5:55:53 GMT -5
An alternative is to set up one shot button presses. It can prevent the space bar and enter key from initiating duplicate handling. However it may confuse users a little as it also stops the button from repeating.
'nomainwin global oldhandle$ WindowWidth = 400 WindowHeight = 400 UpperLeftX = int((DisplayWidth-WindowWidth)/2) UpperLeftY = int((DisplayHeight-WindowHeight)/2) button #1.aa, "Add Engine", click, UL, 100, 100, 200,20 button #1.ab, "Del Engine", click, UL, 100, 130,200, 20 button #1.ac, "Add Car ", click, UL, 100, 160, 200,20 button #1.ad, "Del Car ", click, UL, 100, 190,200, 20 button #1.ae, "List Cars ", click, UL, 100, 220,200, 20 button #1.af, "Make Train", click, UL, 100, 250,200, 20 open "Railway Manager" for window as #1 print #1, "trapclose [quit]" wait
sub click handle$ print handle$,oldhandle$ if handle$<>oldhandle$ then print "New Button Event";handle$ oldhandle$=handle$ end if end sub
[quit] close #1 end
|
|
|
Post by Chris Iverson on Aug 17, 2022 19:55:43 GMT -5
I think this "default" behavior is pretty weird. I would love to see a switch or some mechanism to prevent the last button used magically becoming the default control. This is basically how Windows has always worked from the very beginning, and part of it is because Windows is designed to be used without a mouse, although sadly, not many companies besides Microsoft actually design and test for that anymore. There very much are times(such as with your program) where that stuff simply gets in the way, and those cases are why you can override the system(for example, just manually setting focus like you do.) But those conventions are there for a reason. (Big wall of text below, nothing important, just talking about how mouse vs. keyboard input works. TL;DR: it's a very old convention, that I wish more things would follow.) It's very consistent. The mouse pointer ALWAYS sets focus on the last (active) window object it interacted with. Very simple rule. Click into a textbox? Focus. Click on a combobox? Focus. Click a button? Focus. But why can buttons get focus? Because that's how you use the system without a mouse. You can use TAB, the arrow keys, and accelerator keys to change focus to the item you want, and then spacebar or enter to "click" on it. All Windows UI elements can be navigated like this. That's the standard of how Windows has been for 30+ years now, and I find myself often anywhere from annoyed to absolutely infuriated when something ignores those conventions, and I can no longer interact with it without a mouse. For me, moving focus using the keyboard can often be faster than a mouse for just single clicks. It slows me down to have to break out of what I'm doing, reach and grab the mouse, click once, and move back. Also, the whole "using focus to choose what you can interact with" is what all of the accessibility tech is built on, for blind/disabled people who use things like screen readers to interact with their systems. Not that anyone ever actually seems to try to give a damn to make programs accessible. Heck, I remember one time recently, I was trying to set up a new multi-thousand-dollar HP server for my work. It was racked in a server rack, and I was setting up the hard drives to work as a RAID array before installing the OS on it. The server only had one USB port on the front, with a couple more on the back. The problem was, with it already being in the server rack, I couldn't reach the USB ports in the back. With only a single USB port to work with, I figured I wouldn't need a mouse(you often don't for BIOS/UEFI config stuff), so I plugged a keyboard in. I got through the entire configuration successfully, all the way from fresh boot into BIOS/UEFI config, and then into the HP Smart RAID utility. The utility was a full GUI utility, with a mouse cursor, but I was able to navigate through everything and get the drives successfully configured as a RAID array. And then I had to exit the utility, and couldn't. The ONLY way to save the drive configuration and exit the Smart RAID utility was the 'X'/Close button in the upper right corner - that could NOT be navigated to by keyboard. There was no other menu option or anything(like a F-key or ESC) that could do it. I was able to do the ENTIRE THING, but I wasn't able to SAVE IT and BOOT the stupid server without unplugging the keyboard, finding and plugging in a mouse, and CLICKING ONE BUTTON. It was such a stupid, petty thing, but at the time, it was so infuriating that such a basic oversight was made. Even a full Windows OS install can be done without a mouse! Microsoft can get it right! Why can't anyone else?!
|
|
|
Post by Brandon Parker on Aug 17, 2022 20:52:11 GMT -5
I agree with everything that has been said thus far.
Instead of a button, I would just use a StaticText that is empty, outside of the window viewing area, and of zero dimension. Just set the focus to that after every button click event.
NoMainWin StaticText #Test.stcDummy, "", -1, -1, 0, 0 BMPButton #Test.arrow1, "bmp\arrwbttn.bmp", arrowClicked, UL, 10, 10 BMPButton #Test.arrow2, "bmp\arrwbttn.bmp", arrowClicked, UL, 35, 10 Open "Button Example" For Window As #Test Wait
Sub arrowClicked handle$ Notice handle$;" was clicked." result = SetFocus(HWnd(#Test.stcDummy)) End Sub
Sub quit handle$ Close #handle$ End End Sub
Function SetFocus(hWnd) CallDLL #user32, "SetFocus", hWnd As ulong, _ SetFocus As ulong End Function
{:0)
Brandon Parker
|
|
|
Post by Walt Decker on Aug 19, 2022 15:07:06 GMT -5
Actually one does not have to resort to a dummy control. If the bitmap buttons are placed on separate windows and the windows are then made the CHILD of another window (parent), the focus can be set to the PARENT. If the end user then presses ENTER, SPACE, or whatever, the event handler will not be activated until s/he clicks on a bitmap button. The following code illustrates the process:
' WHITE = HEXDEC("&HFFFFFF") SYSTEM.FONT = 13
OPEN "User32.Dll" FOR DLL AS #USER OPEN "Gdi32.Dll" FOR DLL AS #GDI
RetVal = 0 WinHndl = 0 ChrCnt = -1
GLOBAL SysFont, _ LowId
DIM ChrStr$(25)
SysFont = FN.StockObj(SYSTEM.FONT) LowId = 1000
A$ = ""
FOR I = ASC("A") TO ASC("Z") ChrCnt = ChrCnt + 1 ChrStr$(ChrCnt) = FN.StrRepeat$(CHR$(I), 4)
NEXT I
RetVal = FN.CreateMemBmp(50, 50, WHITE) RetVal = FN.SetMemBmpHndl("WHITE", RetVal) RetVal = FN.SaveMemBmp("WHITE", "WHITE.BMP") RetVal = FN.KillMemBmp("WHITE")
OPEN "BMPBUTTONS" FOR WINDOW AS #WIN PRINT #WIN, "TRAPCLOSE CLOSE.WIN"
WinHndl = FN.GetHandle("#WIN")
RetVal = FN.CreateBmpButtons(WinHndl, 1000, 25, 50, 50, "WHITE.BMP") RetVal = FN.MoveButtons(50, 50)
WAIT
END
'---------------------------------------------------------------- '----------------------------------------------------------------
SUB BTN.EVENT BtnHndl$ '################################################## ' BITMAP BUTTON EVENT HANDLER '##################################################
BLACK = 0 RED = 255 GREEN = HEXDEC("&H008000") BLUE = HEXDEC("&HFF0000") WHITE = HEXDEC("&HFFFFFF")
DT.CENTER = HEXDEC("&H00000001") 'See "DrawTextA" DT.VCENTER = HEXDEC("&H00000004") DT.SINGLELINE = HEXDEC("&H00000020") DT.TXT = DT.CENTER OR DT.VCENTER OR DT.SINGLELINE
TRANSPARENT = 1
STRUCT tRect, _ X AS LONG, _ Y AS LONG, _ X1 AS LONG, _ Y1 AS LONG
CtlHndl = 0 MemHndl = 0 MemFlag = 0 ChrId = 0 ChrPos = 0 OldBmp = 0 OldFnt = 0 OldMode= 0 OldClr = 0
Char$ = ""
ChrId = INT(RND(0) * 26) ChrPos = INT(RND(0) * 4) + 1 Char$ = MID$(ChrStr$(ChrId), ChrPos, 1)
MemHndl = FN.LoadBmpFile("WHITE", "WHITE.BMP")
WinHndl = FN.DeskTop() WinDc = FN.GetDc(WinHndl) WinCmDc = FN.CompatDc(WinDc) WinDc = FN.DetachDc(WinHndl, WinDc)
OldMode = FN.BkgMode(WinCmDc, TRANSPARENT)
SELECT CASE ChrPos CASE 1 OldClr = FN.TextColor(WinCmDc, BLACK)
CASE 2 OldClr = FN.TextColor(WinCmDc, RED)
CASE 3 OldClr = FN.TextColor(WinCmDc, GREEN)
CASE 4 OldClr = FN.TextColor(WinCmDc, BLUE) END SELECT
OldBmp = FN.AttachObj(WinCmDc, MemHndl)
OldFnt = FN.AttachObj(WinCmDc, SysFont)
tRect.X.struct = 4 tRect.Y.struct = 4 tRect.X1.struct = 46 tRect.Y1.struct = 46
CALLDLL #USER, "DrawTextA", WinCmDc AS ULONG, Char$ AS PTR, 1 AS LONG, _ tRect AS STRUCT, DT.TXT AS ULONG, RetVal AS LONG
OldBmp = FN.AttachObj(WinCmDc, OldBmp) OldFnt = FN.AttachObj(WinCmDc, OldFnt) OldMode = FN.BkgMode(WinCmDc, OldMode) OldClr = FN.TextColor(WinCmDc, OldClr)
WinCmDc = FN.KillDc(WinCmDc)
PRINT #BtnHndl$, "bitmap WHITE"
WinHndl = FN.GetHandle("#WIN") '<--- REMOVE FOCUS FROM LAST BUTTON CLICKED CALLDLL #USER, "SetFocus", WinHndl AS ULONG, WinCmDc AS VOID
END SUB
'---------------------------------------------------------------- '----------------------------------------------------------------
SUB CLOSE.WIN WinStr$
FOR I = 1 TO 25 Title$ = "#" + STR$(I) + "BMP" CLOSE #Title$ NEXT I CLOSE #USER CLOSE #GDI 'CLOSE #NUM CLOSE #WinStr$
END SUB
'---------------------------------------------------------------- '----------------------------------------------------------------
FUNCTION FN.StrRepeat$(Char$, NumChrs)
ChrStr$ = ""
FOR I = 1 TO NumChrs ChrStr$ = ChrStr$ + Char$ NEXT I
FN.StrRepeat$ = ChrStr$ END FUNCTION
'---------------------------------------------------------------- '----------------------------------------------------------------
FUNCTION FN.CreateBmpButtons(PrntHndl, BtnId, NumBtns, Wwide, Whigh, FileName$)
WS.CHILD = HEXDEC("&H40000000") WS.VISIBLE = HEXDEC("&H10000000") WS.CLIPCHILDREN = HEXDEC("&H02000000") WS.TABSTOP = HEXDEC("&H00010000")
WS.EX.TOPMOST = HEXDEC("&H00000008") WS.EX.CONTROLPARENT = HEXDEC("&H00010000")
GWL.STYLE = -16 GWL.EXSTYLE = -20
Style = WS.CHILD OR WS.VISIBLE OR WS.CLIPCHILDREN OR WS.TABSTOP ExStyle = WS.EX.TOPMOST OR WS.EX.CONTROLPARENT
WinHndl = 0 BtnHndl = 0 RetVal = 0
DIM BtnName$(24)
FOR I = 1 TO NumBtns Title$ = "BMP"
BMPBUTTON #BMP.BMP1, FileName$, BTN.EVENT, UL, 0, 0 OPEN "DUMMY" FOR WINDOW AS #BMP
WinHndl = FN.GetHandle("#BMP")
CALLDLL #USER, "SetWindowLongA", WinHndl AS ULONG, GWL.STYLE AS LONG, _ Style AS ULONG, RetVal AS VOID CALLDLL #USER, "SetWindowLongA", WinHndl AS ULONG, GWL.EXSTYLE AS LONG, _ ExStyle AS ULONG, RetVal AS VOID
Title$ = "#" + STR$(I) + Title$ BtnName$(I - 1) = Title$ MAPHANDLE #BMP, Title$ CALLDLL #USER, "SetParent", WinHndl AS ULONG, PrntHndl AS ULONG, RetVal AS VOID NEXT I
END FUNCTION
'---------------------------------------------------------------- '----------------------------------------------------------------
FUNCTION FN.MoveButtons(Wwide, Whigh)
Xoffs = 3 Yoffs = 3
I = 0 J = 0
Count = -1
WinHndl = 0
Title$ = ""
FOR I = 1 TO 5 FOR J = 1 TO 5 Count = Count + 1 Title$ = BtnName$(Count) WinHndl = FN.GetHandle(Title$) CALLDLL #USER, "MoveWindow", WinHndl AS ULONG, Xoffs AS LONG, _ Yoffs AS LONG, Wwide AS LONG, Whigh AS LONG, _ 1 AS LONG, RetVal AS VOID Xoffs = Xoffs + Wwide + 2 NEXT J Xoffs = 3 Yoffs = Yoffs + Whigh + 2 NEXT I
REDIM BtnName$(-1) END FUNCTION
'---------------------------------------------------------------- '----------------------------------------------------------------
FUNCTION FN.LoadBmpFile(Tag$, LoadName$)
BmpHndl = 0
LOADBMP Tag$, LoadName$
BmpHndl = HBMP(Tag$)
FN.LoadBmpFile = BmpHndl END FUNCTION
'--------------------------------------------------------------------- '---------------------------------------------------------------------
FUNCTION FN.SaveMemBmp(Tag$, SaveName$) '########################################################### ' Save a memory bitmap to mass storage. ' ARGUMENTS: ' Tag$: String name assigned when the bitmap was ' loaded by LOADBMP or creaged by "getbmp" ' SaveName$: File name to use for saving. May include ' a mass storage path. '###########################################################
BMPSAVE Tag$, SaveName$
END FUNCTION
'--------------------------------------------------------------------- '---------------------------------------------------------------------
FUNCTION FN.KillMemBmp(Tag$) '########################################################### ' Remove bitmap created by Liberty Basic from memory ' ARGUMENTS: ' Tag$: String name assigned to memory bitmap ' when it was created by LOADBMP or "getbmp" '###########################################################
UNLOADBMP Tag$
END FUNCTION
'--------------------------------------------------------------------- '---------------------------------------------------------------------
FUNCTION FN.SetMemBmpHndl(Tag$, BmpHndl) '########################################################### ' Assign a name to a memory bitmap object and set its ' numeric handle property. ' ARGUMENTS: ' Tag$: String name to assign. EXAMPLE: Tag$ = "SPIDER". ' BmpHndl: Numeric handle of a memory bitmap. '###########################################################
LOADBMP Tag$, BmpHndl
END FUNCTION
'--------------------------------------------------------------------- '---------------------------------------------------------------------
FUNCTION FN.CheckTag$(Tag$)
IF LEFT$(Tag$, 1) <> "#" THEN Tag$ = "#" + Tag$
FN.CheckTag$ = Tag$ END FUNCTION
'--------------------------------------------------------------------- '---------------------------------------------------------------------
FUNCTION FN.GetHandle(WinTag$)
Handle = 0
WinTag$ = FN.CheckTag$(WinTag$)
Handle = HWND(#WinTag$) FN.GetHandle = Handle END FUNCTION
'--------------------------------------------------------------------- '---------------------------------------------------------------------
FUNCTION FN.CreateMemBmp(BmpWide, BmpHigh, RgbColor)
RetVal = 0 WinHndl = 0 MemHndl = 0 WinCmDc = 0 WinDc = 0
OrigBmp = 0
WinHndl = FN.DeskTop() WinDc = FN.GetDc(WinHndl) WinCmDc = FN.CompatDc(WinDc) WinDc = FN.DetachDc(WinHndl, WinDc) MemHndl = FN.CreateDIB(WinCmDc, BmpWide, BmpHigh)
OrigBmp = FN.AttachObj(WinCmDc, MemHndl) RetVal = FN.ClearBmp(WinCmDc, RgbColor, BmpWide, BmpHigh) RetVal = FN.Shadow(WinCmDc) OrigBmp = FN.AttachObj(WinCmDc, OrigBmp) WinCmDc = FN.KillDc(WinCmDc)
FN.CreateMemBmp = MemHndl END FUNCTION
'-------------------------------------------------------------------- '--------------------------------------------------------------------
FUNCTION FN.DeskTop() '###################################################################### ' Get a handle to the monitor '######################################################################
DtHndl = 0 CALLDLL #USER, "GetDesktopWindow", DtHndl AS ULONG
FN.DeskTop = DtHndl END FUNCTION
'--------------------------------------------------------------- '---------------------------------------------------------------
FUNCTION FN.GetDc(WinHndl) '###################################################################### ' Get a context from MSWIN for the device (form window, control, ' printer, audio, external device). '######################################################################
WinDc = 0 CALLDLL #USER, "GetDC", WinHndl AS ULONG, WinDc AS ULONG
FN.GetDc = WinDc END FUNCTION
'--------------------------------------------------------------- '---------------------------------------------------------------
FUNCTION FN.CompatDc(WinDc) '###################################################################### ' Create a context compatible with a device. ' ' ARGUMENTS: ' WinDc: Device context. ' Do NOT use user32.dll ReleaseDC(), use gdi32.DLL ' DeleteDC() instead. '######################################################################
ComPatDc = 0 CALLDLL #GDI, "CreateCompatibleDC", WinDc AS ULONG, ComPatDc AS ULONG
FN.CompatDc = ComPatDc END FUNCTION
'------------------------------------------------------------------- '-------------------------------------------------------------------
FUNCTION FN.DetachDc(WinHndl, WinDc) '###################################################################### ' Release a device context and its resources ' ' ARGUMENTS: ' WinHndl: The handle of a form window or control. ' WinDc: Device context obtained from GetDc(). '######################################################################
RetVal = 0 CALLDLL #USER, "ReleaseDC", WinHndl AS ULONG, WinDc AS ULONG, RetVal AS VOID END FUNCTION
'--------------------------------------------------------------- '---------------------------------------------------------------
FUNCTION FN.CreateDIB(ComPatDc, BmWide, BmHigh)
STRUCT tBITMAPINFO, _ '<--- bitmap information structure StrSize AS ULONG, _ '<--- size of structure Width AS LONG, _ '<--- width of bitmap Height AS LONG, _ '<--- height of bitmap Planes AS SHORT, _ '<--- number of color planes BitCount AS SHORT, _ '<--- number of bits to define colors Compression AS ULONG, _ '<--- type of compression; See Below SizeImage AS ULONG, _ '<--- size of image XPelsPerMeter AS LONG, _ '<--- number of pixels per meter YPelsPerMeter AS LONG, _ ClrUsed AS ULONG, _ '<--- number of colors in the bitmap ClrImportant AS ULONG, _ '<--- important colors Colors AS ULONG '<--- array of color in BRG format
BI.RGB = 0 'An uncompressed format.
DIB.RGB.COLORS = 0
BmpHndl = 0
tBITMAPINFO.StrSize.struct = LEN(tBITMAPINFO.struct) tBITMAPINFO.Width.struct = BmWide tBITMAPINFO.Height.struct = -1 * BmHigh '<--- top-down instead of bottom up tBITMAPINFO.Planes.struct = 1 tBITMAPINFO.BitCount.struct = 32 tBITMAPINFO.Compression.struct = BI.RGB
CALLDLL #GDI, "CreateDIBSection", ComPatDc AS ULONG, tBITMAPINFO AS STRUCT, _ DIB.RGB.COLORS AS LONG, 0 AS LONG, 0 AS LONG, 0 AS LONG, _ BmpHndl AS ULONG
FN.CreateDIB = BmpHndl END FUNCTION
'----------------------------------------------------------- '----------------------------------------------------------- FUNCTION FN.ClearBmp(BmpDc, RgbColor, Wide, High) '################################################### ' Fill a memory bitmap with color ' ARGUMENTS: ' BmpDc: Compatible device context ' RgbColor: 32-bit value defining a color ' Wide, High: Size of bitmap '###################################################
PS.SOLID = 0 '<--- pen style
RetVal = 0 '<--- dummy value
Brush = 0 '<--- brush handle Pen = 0 '<--- pen handle
OldBrsh = 0 '<--- original objects OldPen = 0
Wide = Wide + 1 High = High + 1
Brush = FN.SolidBrush(RgbColor) '<--- create a brush Pen = FN.Pen(PS.SOLID, 0, RgbColor) '<--- create a pen
OldPen = FN.AttachObj(BmpDc, Pen) '<--- make pen and brush active OldBrsh = FN.AttachObj(BmpDc, Brush)
'<----------- color the bitmap ----------------------------------> CALLDLL #GDI, "Rectangle", BmpDc AS ULONG, -1 AS LONG, -1 AS LONG, _ Wide AS LONG, High AS LONG, RetVal AS VOID
OldPen = FN.AttachObj(BmpDc, OldPen) '<--- detatch pen and brush OldBrsh = FN.AttachObj(BmpDc, OldBrsh)
RetVal = FN.KillObj(Brush) '<--- delete brush and pen RetVal = FN.KillObj(Pen)
END FUNCTION
'------------------------------------------------------------ '------------------------------------------------------------
FUNCTION FN.AttachObj(WinDc, ThisObject) '###################################################################### ' Make an object (pen, brush, font, bitmap) active. ' ' ARGUMENTS: ' WinDc: Device context handle ' ThisObject: Object to make active. '######################################################################
OrgObj = 0 CALLDLL #GDI, "SelectObject", WinDc AS ULONG, ThisObject AS ULONG, _ OrgObj AS ULONG
FN.AttachObj = OrgObj END FUNCTION
'--------------------------------------------------------------- '---------------------------------------------------------------
FUNCTION FN.Pen(Pstyle, Wide, Pcolor) '########################################################### ' Creates a pen of the specied style, width and color. ' If the Pstyle parameter is not PS.SOLID and the ' Wide parmeter is greather than one, the style will ' be PS.SOLID regardless of the style specified by ' Pstyle '###########################################################
PenHndl = 0 CALLDLL #GDI, "CreatePen", Pstyle AS LONG, Wide AS LONG, _ Pcolor AS ULONG, PenHndl AS ULONG
FN.Pen = PenHndl END FUNCTION
'------------------------------------------------------------------------- '-------------------------------------------------------------------------
FUNCTION FN.SolidBrush(FillColor) '########################################################### ' Creats a fill bitmap of the specified color '###########################################################
BrushHndl = 0 CALLDLL #GDI, "CreateSolidBrush", FillColor AS ULONG, BrushHndl AS ULONG
FN.SolidBrush = BrushHndl END FUNCTION
'------------------------------------------------------------------------ '------------------------------------------------------------------------
FUNCTION FN.StockObj(ObjIdx) '#################################################################### ' Return a windows standard object ' ARGUMENTS: ' ObjIdx: Index of windows standard object '####################################################################
Object = 0 CALLDLL #GDI, "GetStockObject", ObjIdx AS LONG, Object AS ULONG
FN.StockObj = Object END FUNCTION
'------------------------------------------------------------ '------------------------------------------------------------
FUNCTION FN.KillDc(WinDc) '############################################################ ' Destroy a device context and release WIN resources ' ' ARGUMENTS: ' WinDc: Device context to destroy. ' Do NOT use this function to destroy a device ' context obtained with the GetDC() function. '############################################################
RetVal = 0 CALLDLL #GDI, "DeleteDC", WinDc AS ULONG, RetVal AS VOID
END FUNCTION
'----------------------------------------------------------------- '-----------------------------------------------------------------
FUNCTION FN.KillObj(ThisObj) '###################################################################### ' Destroy an object (brush, pen, font) and release its resources '######################################################################
DeadObj = 0 CALLDLL #GDI, "DeleteObject", ThisObj AS ULONG, DeadObj AS VOID
END FUNCTION
'--------------------------------------------------------------- '---------------------------------------------------------------
FUNCTION FN.MoveTo(WinDc, Xp, Yp)
RetVal = 0 CALLDLL #GDI, "MoveToEx", WinDc AS ULONG, Xp AS LONG, Yp AS LONG, _ 0 AS LONG, RetVal AS VOID END FUNCTION
'--------------------------------------------------------------------- '---------------------------------------------------------------------
FUNCTION FN.LineTo(WinDc, Xp, Yp)
RetVal = 0 CALLDLL #GDI, "LineTo", WinDc AS ULONG, Xp AS LONG, Yp AS LONG, RetVal AS VOID
END FUNCTION
'--------------------------------------------------------------------- '---------------------------------------------------------------------
FUNCTION FN.BkgMode(WinDc, BkMode)
OldMode = 0 CALLDLL #GDI, "SetBkMode", WinDc AS ULONG, BkMode AS LONG, OldMode AS LONG
FN.BkgMode = OldMode END FUNCTION
'--------------------------------------------------------------------- '---------------------------------------------------------------------
FUNCTION FN.TextColor(WinDc, TxtColor)
DefColor = 0 CALLDLL #GDI, "SetTextColor", WinDc AS ULONG, TxtColor AS ULONG, _ DefColor AS ULONG
FN.TextColor = DefColor END FUNCTION
'--------------------------------------------------------------------- '---------------------------------------------------------------------
FUNCTION FN.Shadow(WinDc)
PS.SOLID = 0
DARKGRAY = HEXDEC("&HA9A9A9") PAILGRAY = HEXDEC("&HDCDCDC")
OrigPen = 0 Pen = 0
Pen = FN.Pen(PS.SOLID, 3, PAILGRAY) OrigPen = FN.AttachObj(WinDc, Pen) RetVal = FN.MoveTo(WinDc, 0, 1) RetVal = FN.LineTo(WinDc, 47, 1) RetVal = FN.MoveTo(WinDc, 0, 1) RetVal = FN.LineTo(WinDc, 0, 47) RetVal = FN.AttachObj(WinDc, OrigPen) RetVal = FN.KillObj(Pen)
Pen = FN.Pen(PS.SOLID, 3, DARKGRAY) OrigPen = FN.AttachObj(WinDc, Pen) RetVal = FN.MoveTo(WinDc, 48, 0) RetVal = FN.LineTo(WinDc, 48, 50) RetVal = FN.MoveTo(WinDc, 0, 48) RetVal = FN.LineTo(WinDc, 50, 48)
OrigPen = FN.AttachObj(WinDc, OrigPen) Pen = FN.KillObj(Pen)
END FUNCTION
'--------------------------------------------------------------------- '---------------------------------------------------------------------
'
|
|