Page 1 of 1

Change the colour of the selection gutter of a richedit

Posted: Sat Oct 08, 2005 10:04 am
by Trond

Code: Select all

Global MainWindowID
Global EditorHandle, EditorID

Procedure EdResizeClient()
  MoveWindow_(EditorID, 0, 0, WindowWidth(), WindowHeight(), 0)
  EditorRect.RECT\left = 20
  EditorRect\top = 2
  EditorRect\right = WindowWidth() - EditorRect\left
  EditorRect\bottom = WindowHeight()
  SendMessage_(EditorID, #EM_SETRECT, 0, EditorRect)
EndProcedure

Procedure MainFormShowModal()
  Wnd_StdParam = #PB_Window_SystemMenu | #PB_Window_MaximizeGadget | #PB_Window_SizeGadget
  Wnd_StdParam = Wnd_StdParam | #PB_Window_MinimizeGadget | #PB_Window_WindowCentered | #PB_Window_Invisible
  
  MainWindowID = OpenWindow(#PB_Any, 0, 0, 640, 480, Wnd_StdParam, "See Sharp")
  CreateGadgetList(WindowID(MainWindowID))
  ;Create the editor and do some stuff with it
  EditorHandle = EditorGadget(#PB_Any, 0, 0, 20, 20)
  EditorID     = GadgetID(EditorHandle)
  FontHandle   = LoadFont(#PB_Any, "Courier New", 10)
  
  ;Show the window and activate the editor
  HideWindow(MainWindowID, 0)
  ActivateGadget(EditorHandle)
  
  Repeat
    EventID = WaitWindowEvent()
    Select EventID
      Case #PB_Event_CloseWindow
        Quit = 1
      Case #PB_Event_SizeWindow
        EdResizeClient()
      
    EndSelect
  Until Quit = 1

EndProcedure


MainFormShowModal()
You see the selection gutter? How can I change the colour of it?

Posted: Sat Oct 08, 2005 1:22 pm
by GeoTrail
I can't see anything apart from the white editor space.

Posted: Sat Oct 08, 2005 3:11 pm
by Trond
GeoTrail wrote:I can't see anything apart from the white editor space.
That's because the selection gutter is white too! Type a few lines and you'll see what I mean.

Edit: The selection gutter is area at the left of the text where the cursor changes into a reversed cursor and you can select text.

Posted: Sat Oct 08, 2005 11:34 pm
by GeoTrail
Aaa I see it now :)