|
Post by Carl Gundel on Sept 15, 2019 20:53:45 GMT -5
It would be good to have a list of the things that people cannot live without that are only possible in LB4 through APIs so that I can try and duplicate some of these in LB5 in native commands.
Please add to this thread your favorites.
|
|
|
Post by pandawdy on Sept 15, 2019 23:15:32 GMT -5
Winsock. The ability to send and receive both through UDP and TCP.
|
|
|
Post by Rod on Sept 16, 2019 5:57:51 GMT -5
Get and set printer orientation.
Read any key on the fly, getasynckeystate()
Sound/media mciSendStringA
|
|
|
Post by tsh73 on Sept 16, 2019 6:42:41 GMT -5
Clipboard access would be nice
|
|
cundo
Full Member
Muchas Gracias!!
Posts: 146
|
Post by cundo on Sept 18, 2019 13:55:52 GMT -5
Know where the mouse is? X and Y position Hide the cursor. Know exact client size of the available workspace in a window.
|
|
|
Post by bluatigro on Sept 27, 2019 4:15:37 GMT -5
a polygon and/or openGL stuf or a include comand swap sgn()
|
|
|
Post by donnybowers on Nov 7, 2019 12:00:37 GMT -5
I always found the "always_on_top" api useful for certain applications. The ability to default to "always_on_top" and then toggle to the various modes (i.e. same as other windows, below other windows etc.) can be very useful. It's not as important to us Linux users because we can use the context window of the title bar to switch between these modes, but Windows doesn't have that option (or at least didn't when I was using it). But, even in Linux it would be nice to be able to default your program to whichever mode of this api you deem more useful for a given application.
|
|
|
Post by Gordon Rahman on Nov 7, 2019 17:42:16 GMT -5
LB5 already has the build-in ability to setBkMode for texts on graphics (BMP or JPG)
Maybe LB5 needs the possibilities of Stylebits too.
Gordon
|
|
|
Post by Carl Gundel on Nov 8, 2019 14:15:28 GMT -5
LB5 already has the build-in ability to setBkMode for texts on graphics (BMP or JPG) Maybe LB5 needs the possibilities of Stylebits too. Gordon STYLEBITS may be simulate-able if that's a word. Later on we will have support for native widgets alongside the emulated ones. In that case STYLEBITS will be a first class option, but only for Windows.
|
|
|
Post by Gordon Rahman on Nov 10, 2019 11:05:01 GMT -5
Wow, STYLEBITS.
Is there a possibility for getpixel(x,y) I saw set(x,y) to draw a pixel.
I also use frequent this FLOODFILLborder API when filling an polygoon figure.
[quit] RelMemory = ReleaseDC(hw,hdc) close #w end
Function GetDC(handl) CallDLL #user32, "GetDC", _ handl As Ulong, _ GetDC as Ulong End Function
Function ExtFloodFill(hdc,x,y) ',fillCol$) wFillType =_FLOODFILLBORDER Color =0 '#w "backcolor "; fillCol$ CallDll #gdi32,"ExtFloodFill",_ hdc as Ulong,_ x as long,_ y as long,_ Color as long,_ wFillType as long,_ ExtFoodFill as long End Function
Function ReleaseDC(handle, hDC) CallDLL #user32, "ReleaseDC", _ handle As Ulong, _ hDC As Ulong, _ ReleaseDC As Long End Function
|
|
|
Post by Carl Gundel on Nov 10, 2019 17:13:37 GMT -5
Wow, STYLEBITS. Is there a possibility for getpixel(x,y) I saw set(x,y) to draw a pixel. I also use frequent this FLOODFILLborder API when filling an polygoon figure. [quit] RelMemory = ReleaseDC(hw,hdc) close #w end
Function GetDC(handl) CallDLL #user32, "GetDC", _ handl As Ulong, _ GetDC as Ulong End Function
Function ExtFloodFill(hdc,x,y) ',fillCol$) wFillType =_FLOODFILLBORDER Color =0 '#w "backcolor "; fillCol$ CallDll #gdi32,"ExtFloodFill",_ hdc as Ulong,_ x as long,_ y as long,_ Color as long,_ wFillType as long,_ ExtFoodFill as long End Function
Function ReleaseDC(handle, hDC) CallDLL #user32, "ReleaseDC", _ handle As Ulong, _ hDC As Ulong, _ ReleaseDC As Long End Function
Get pixel? Probably. Flood fill? Maybe.
|
|
|
Post by tenochtitlanuk on Nov 12, 2019 15:35:05 GMT -5
Some samples of things I can draw so easily in LB with the flood-fill and a sub that generates polygons and stellated polygons. YES-- I too like fill and getpixel!!
|
|
|
Post by Carl Gundel on Nov 12, 2019 21:17:32 GMT -5
Some samples of things I can draw so easily in LB with the flood-fill and a sub that generates polygons and stellated polygons. YES-- I too like fill and getpixel!! Nice. The Smalltalk VM doesn't come with a flood fill, but I will try my hand at one in Smalltalk. It won't be as fast as one would be in C, but maybe it will be usably fast.
|
|
|
Post by Brandon Parker on Nov 14, 2019 13:03:54 GMT -5
Carl, Anything you can provide us from the Smalltalk end will definitely be faster than an implementation we can contrive, even from using the Windows API (not inclusive of the actual floodfill funciton). Here is one we posted to Rosetta Code quite a while ago. Bitmap/Flood fill - Rosetta Code'This example requires the Windows API NoMainWin WindowWidth = 267.5 WindowHeight = 292.5 UpperLeftX=int((DisplayWidth-WindowWidth)/2) UpperLeftY=int((DisplayHeight-WindowHeight)/2) Global hDC : hDC = GetDC(0) Struct point, x As long, y As long Struct RGB, Red As long, Green As long, Blue As long Struct rect, left As long, top As long, right As long, bottom As long StyleBits #main.gbox, 0, _WS_BORDER, 0, 0 GraphicBox #main.gbox, 2.5, 2.5, 253, 252 Open "Flood Fill - Click a Color" For Window As #main Print #main, "TrapClose quit" Print #main.gbox, "Down; Fill Black; Place 125 125; BackColor White; " _ + "CircleFilled 115; Place 105 105; BackColor Black; CircleFilled 50; Flush" Print #main.gbox, "When leftButtonUp gBoxClick" Print #main.gbox, "Size 1" Wait Sub quit handle$ Call ReleaseDC 0, hDC Close #main End End Sub Sub gBoxClick handle$, MouseX, MouseY result = GetCursorPos() targetRGB = GetPixel(hDC, point.x.struct, point.y.struct) ColorDialog "", replacementColor$ If replacementColor$ = "" Then Exit Sub Print #main.gbox, "Color " + Word$(replacementColor$, 1) + " " + Word$(replacementColor$, 2) + " " + Word$(replacementColor$, 3) result = FloodFill(MouseX, MouseY, targetRGB) Print #main.gbox, "DelSegment FloodFill" Print #main.gbox, "GetBMP FloodFill 0 0 500 500; CLS; DrawBMP FloodFill 0 0; Flush FloodFill" Notice "Complete!" UnLoadBMP "FloodFill" End Sub Sub ReleaseDC hWnd, hDC CallDLL #user32,"ReleaseDC", hWnd As uLong, hDC As uLong, ret As Long End Sub Function GetDC(hWnd) CallDLL #user32, "GetDC", hWnd As uLong, GetDC As uLong End Function Function GetCursorPos() CallDLL #user32, "GetCursorPos", point As struct, GetCursorPos As uLong End Function Function GetPixel(hDC, x, y) CallDLL #gdi32, "GetPixel", hDC As uLong, x As long, y As long, GetPixel As long End Function Function getLongRGB(RGB.Blue) getLongRGB = (RGB.Blue * (256 * 256)) End Function Function GetWindowRect(hWnd) 'Get ClientRectangle CallDLL #user32, "GetWindowRect", hWnd As ulong, rect As struct, GetWindowRect As ulong End Function Function FloodFill(mouseXX, mouseYY, targetColor) Scan result = GetWindowRect(Hwnd(#main.gbox)) X = Int(mouseXX + rect.left.struct) Y = Int(mouseYY + rect.top.struct) If (GetPixel(hDC, X, Y) <> targetColor) Then Exit Function Else CLS Print str$(mouseXX) + " " + str$(mouseYY) Print #main.gbox, "Set " + str$(mouseXX) + " " + str$(mouseYY) End If If (mouseXX > 0) And (mouseXX < 253) Then result = FloodFill((mouseXX - 1), mouseYY, targetColor) result = FloodFill((mouseXX + 1), mouseYY, targetColor) End If If (mouseYY > 0) And (mouseYY < 252) Then result = FloodFill(mouseXX, (mouseYY + 1), targetColor) result = FloodFill(mouseXX, (mouseYY - 1), targetColor) End If End Function {:0) Brandon Parker
|
|
cundo
Full Member
Muchas Gracias!!
Posts: 146
|
Post by cundo on Nov 14, 2019 14:06:37 GMT -5
On what I wrote some post above: I think that hiding the mouse pointer would be more useful as a command for each window or graphicBox, so the mouse will be hiding when hovering over an specific window or control, not just always. Think in a game for example, if you leave that window and continue with something else you want your mouse back!
|
|