Help with ownerdraw custom edit gadget
Help with ownerdraw custom edit gadget
I'm not firm with custom drawing windows controls. I just know that it opens the world for very powerful customizations. However, is it possible (with ownerdrawing) to extend an edit gadget with things like the clickable "X" on the right that erases the content or the spyglass in the left? I know I can do it with a canvas gadget and such, but an extended edit gadget would be much more comfortable.
Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
Re: Help with ownerdraw custom edit gadget
How about using a CanvasGadget as a container?
Code: Select all
OpenWindow(0, 0, 0, 320, 200, "", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
CanvasGadget(0, 85, 85, 150, 21, #PB_Canvas_Container)
EditorGadget(1, 25, 1, 100, 19)
CloseGadgetList()
StartDrawing(CanvasOutput(0))
DrawingMode(#PB_2DDrawing_Transparent)
DrawText(7, 2, "...", #Black)
DrawText(134, 2, "x", #Black)
StopDrawing()
While WaitWindowEvent() <> #PB_Event_CloseWindow : Wend
Et cetera is my worst enemy
Re: Help with ownerdraw custom edit gadget
Hi
You can use ButtonGadget() or ButtonImageGadget() too
You can use ButtonGadget() or ButtonImageGadget() too
Code: Select all
OpenWindow(0, 0, 0, 320, 200, "", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
TextGadget(1,290,10,20,20,"X",#WS_CLIPSIBLINGS |#WS_BORDER|#SS_CENTER|#SS_CENTERIMAGE|#SS_NOTIFY)
SetGadgetColor(1,#PB_Gadget_FrontColor,$0000FF)
EditorGadget(0, 5, 5, 310, 190,#WS_CLIPSIBLINGS)
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow
Quit = 1
Case #PB_Event_Gadget
Select EventGadget()
Case 0
Case 1
ClearGadgetItems(0)
EndSelect
EndSelect
Until Quit = 1
Egypt my love
Re: Help with ownerdraw custom edit gadget
...and that's both things I didn't want to...
Good morning, that's a nice tnetennba!
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD
PureBasic 6.21/Windows 11 x64/Ryzen 7900X/32GB RAM/3TB SSD
Synology DS1821+/DX517, 130.9TB+50.8TB+2TB SSD