Hi
Mayby it already written somewhere but i did not find it, so i asc again, howto:
disable in editorgadget scrollbars
disable editorgadget borders
select all text in editoegadget
Thanks
Karu
EditorGadget border and scrollbars
Re: EditorGadget border and scrollbars
Hi
Code: Select all
Procedure Editor_Select(Gadget, LineStart.i, CharStart.i, LineEnd.i, CharEnd.i)
sel.CHARRANGE
sel\cpMin = SendMessage_(GadgetID(Gadget), #EM_LINEINDEX, LineStart, 0) + CharStart - 1
If LineEnd = -1
LineEnd = SendMessage_(GadgetID(Gadget), #EM_GETLINECOUNT, 0, 0)-1
EndIf
sel\cpMax = SendMessage_(GadgetID(Gadget), #EM_LINEINDEX, LineEnd, 0)
If CharEnd = -1
sel\cpMax + SendMessage_(GadgetID(Gadget), #EM_LINELENGTH, sel\cpMax, 0)
Else
sel\cpMax + CharEnd - 1
EndIf
SendMessage_(GadgetID(Gadget), #EM_EXSETSEL, 0, @sel)
EndProcedure
OpenWindow(0,0,0,300,230,"EditorGadget",#PB_Window_SystemMenu|#PB_Window_ScreenCentered)
EditorGadget(1,5,5,290,190)
RemoveGadgetItem(1,0) ;Fix cursor dir with Bidirection system in XP theme enabled
;{ No border
SetWindowLong_(GadgetID(1), #GWL_EXSTYLE,GetWindowLong_(GadgetID(1), #GWL_EXSTYLE)&(~#WS_EX_CLIENTEDGE))
SetWindowPos_(GadgetID(1), 0, 0, 0, 0, 0, #SWP_SHOWWINDOW | #SWP_NOSIZE | #SWP_NOMOVE | #SWP_FRAMECHANGED)
;}
For a=0 To 5
AddGadgetItem(1,a,"Line "+Str(a))
Next
ButtonGadget(2,5,200,100,20,"Select")
Repeat
Select WaitWindowEvent()
Case #PB_Event_CloseWindow: End
Case #PB_Event_Gadget
Select EventGadget()
Case 1
SendMessage_(GadgetID(1), #EM_SHOWSCROLLBAR,#SB_HORZ,0)
SendMessage_(GadgetID(1), #EM_SHOWSCROLLBAR,#SB_VERT,0)
Case 2
Editor_Select(1,0,1,0,1) ;Set cursor at start position
Editor_Select(1,0,1,-1,-1) ;Select the req. text
EndSelect
EndSelect
ForEver
Egypt my love
Re: EditorGadget border and scrollbars
Hi,
somehow GetWindowLong_() doesn't return the right values for the EditorGadget since PB 4.4 ... any idea what was changed and how I can remove the border of the EditorGadget in any other way?
EDIT: Problem only occurs with "XP skin support" on. But it worked perfectly in PB 4.31 ...
regards,
Christian
somehow GetWindowLong_() doesn't return the right values for the EditorGadget since PB 4.4 ... any idea what was changed and how I can remove the border of the EditorGadget in any other way?
EDIT: Problem only occurs with "XP skin support" on. But it worked perfectly in PB 4.31 ...

regards,
Christian
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
Re: EditorGadget border and scrollbars
The EditorGadget doesn't use WS_EX_CLIENTEDGE. It's a special PB fix.
Take a look here: http://www.purebasic.fr/english/viewtop ... 99&start=3
//Edit:
Or use a container gadget:
Take a look here: http://www.purebasic.fr/english/viewtop ... 99&start=3
//Edit:
Or use a container gadget:
Code: Select all
OpenWindow(0,0,0,320,220,"void",#WS_OVERLAPPEDWINDOW | 1)
ContainerGadget(0,10,10,300,200)
EditorGadget(1,-2,-2,304,204)
CloseGadgetList()
While WaitWindowEvent() ! #PB_Event_CloseWindow : Wend
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Re: EditorGadget border and scrollbars
The WS_EX_CLIENTEDGE-Method works with "XP skin support" turned off in the compiler options. Apart from that everything worked fine in PB 4.30 with both, XP skin support turned on or off. So anything was changed in PB 4.40. Any idea what?The EditorGadget doesn't use WS_EX_CLIENTEDGE. It's a special PB fix.
However, you're link seems to do the job now. Thanks!
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
Re: EditorGadget border and scrollbars
Christian wrote:The WS_EX_CLIENTEDGE-Method works with "XP skin support" turned off in the compiler options.
With theme support turned off WS_EX_CLIENTEDGE is used but otherwise PB uses the Windows skinning library to draw the border.Fluid Byte wrote:The EditorGadget doesn't use WS_EX_CLIENTEDGE. It's a special PB fix.
Why? Because a plain RichEdit control created via API doesn't use a themed border by default.
Yes, the drawing library was completely redone in 4.50.Christian wrote:So anything was changed in PB 4.40. Any idea what?
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Re: EditorGadget border and scrollbars
So, PureBasic didn't use the Windows skinning library to draw the border in version 4.30? How was it done before?Fluid Byte wrote:With theme support turned off WS_EX_CLIENTEDGE is used but otherwise PB uses the Windows skinning library to draw the border.
Why? Because a plain RichEdit control created via API doesn't use a themed border by default.
Yes, I know that. But I didn't know that those changes also affect the way the PB Gadgets are drawn.Fluid Byte wrote:Yes, the drawing library was completely redone in 4.50.
- Fluid Byte
- Addict
- Posts: 2336
- Joined: Fri Jul 21, 2006 4:41 am
- Location: Berlin, Germany
Re: EditorGadget border and scrollbars
Nothing was doneChristian wrote:So, PureBasic didn't use the Windows skinning library to draw the border in version 4.30? How was it done before?

The EditorGadget always had a non-themed border (classic look) regardless of the theme settings in the compiler.
The EditorGadget is the only one I know of and it's only a little cosmetic fix.Christian wrote:Yes, I know that. But I didn't know that those changes also affect the way the PB Gadgets are drawn.
Windows 10 Pro, 64-Bit / Whose Hoff is it anyway?
Re: EditorGadget border and scrollbars
I created an EditorGadget in PB 4.30 again and saw that ... you're right.Fluid Byte wrote:Nothing was done![]()

I didn't recognize before that the border of the EditorGadget looked the same way in PB 4.30 regardless of the chosen option for the XP skin support (on or off).

Thanks for your explanations!
Regards,
Christian