Page 1 of 1

Re: XP skinned calendar with no skinned editor?

Posted: Wed Oct 21, 2009 6:19 pm
by Fluid Byte
Nice try srod but that won't work. The themed border isn't actually supported by Windows for RichEdit controls so I'm pretty sure Fred uses an home-brew fix. What you can do is process the #WM_NCPAINT message and permit to draw the themed border.

Code: Select all

OpenWindow(0,450,200,400,453,"void",#PB_Window_SystemMenu | #PB_Window_SizeGadget | #PB_Window_MinimizeGadget | #PB_Window_TitleBar)

CalendarGadget(0,35,15,230,185)
PanelGadget(1,35,220,330,225)
AddGadgetItem(1,-1,"Tab #1")
EditorGadget(2,10,10,295,175)

Global lpPrevFunc

Procedure RichEditProc(hWnd,uMsg,wParam,lParam)
	Select uMsg
		Case #WM_NCPAINT
		GetClientRect_(hwnd,crc.RECT)
		hdc = GetWindowDC_(hWnd)
		hPenBorder = CreatePen_(#PS_INSIDEFRAME,2,GetSysColor_(#COLOR_WINDOW))
		SelectObject_(hdc,hPenBorder)
		SelectObject_(hdc,GetStockObject_(#NULL_BRUSH))
		Rectangle_(hdc,0,0,crc\right + 4,crc\bottom + 4)
		DeleteObject_(hPenBorder)
		ReleaseDC_(hwnd,hdc)
		ProcedureReturn 0
	EndSelect
	
	ProcedureReturn CallWindowProc_(lpPrevFunc,hWnd,uMsg,wParam,lParam)
EndProcedure

lpPrevFunc = SetWindowLong_(GadgetID(2),#GWL_WNDPROC,@RichEditProc())

SetWindowPos_(GadgetID(2), 0, 0, 0, 0, 0,#SWP_NOSIZE | #SWP_NOMOVE | #SWP_FRAMECHANGED)

While WaitWindowEvent() ! #PB_Event_CloseWindow : Wend

Re: XP skinned calendar with no skinned editor?

Posted: Wed Oct 21, 2009 6:23 pm
by srod
Ah, yes of course - daft twit I am. Should have known better. :)

Must admit that I didn't try it as I'm up to my neck in malfunctioning code right now ... my own code that is! :wink:

Re: XP skinned calendar with no skinned editor?

Posted: Wed Oct 21, 2009 6:45 pm
by RASHAD
I had enough trouble for one day
I should't respond
is that what you are after rsts?
Do not answer

Code: Select all

;{ Windows
Enumeration
  #Window_0
EndEnumeration
;}
Global gadget_0_editor
;{ Gadgets
Enumeration
  #Calendar_0
  #Panel_1

EndEnumeration
;}
Define.l Event, EventWindow, EventGadget, EventType, EventMenu



    OpenWindow(#Window_0, 450, 200, 400, 453, "Window_0", #PB_Window_SystemMenu|#PB_Window_SizeGadget|#PB_Window_MinimizeGadget|#PB_Window_TitleBar)

      CalendarGadget(#Calendar_0, 35, 15, 225, 160)
      pHwnd=PanelGadget(#Panel_1, 35, 220, 330, 225)
        ; Tab #1
        AddGadgetItem(#Panel_1, -1, "Tab #1")
       gadget_0_editor= EditorGadget(#PB_Any, 10, 10, 295, 175)
       SetWindowTheme_(pHwnd, @null.w, @null.w)
        style = GetWindowLong_(GadgetID(Gadget_0_Editor), #GWL_EXSTYLE)
       newstyle = style &(~#WS_EX_CLIENTEDGE)
       SetWindowLong_(GadgetID(Gadget_0_Editor), #GWL_EXSTYLE, newstyle)
      SetWindowPos_(GadgetID(Gadget_0_Editor), 0, 0, 0, 0, 0, #SWP_SHOWWINDOW | #SWP_NOSIZE | #SWP_NOMOVE | #SWP_FRAMECHANGED) ; required for this to work on my Win98



;{- Event loop
Repeat
  Event = WaitWindowEvent()
  Select Event
    ; ///////////////////
    Case #PB_Event_Gadget
      EventGadget = EventGadget()
      EventType = EventType()
      If EventGadget = #Calendar_0
      ElseIf EventGadget = #Panel_1
     
      EndIf
    ; ////////////////////////
    Case #PB_Event_CloseWindow
      EventWindow = EventWindow()
      If EventWindow = #Window_0
        CloseWindow(#Window_0)
        Break
      EndIf
  EndSelect
ForEver
;
;}

Re: XP skinned calendar with no skinned editor?

Posted: Wed Oct 21, 2009 7:18 pm
by Arctic Fox
Seems that I misunderstood this :?

Re: XP skinned calendar with no skinned editor?

Posted: Wed Oct 21, 2009 7:34 pm
by rsts
Yes, Mr Byte, that looks quite nice. Many thanks.

Now to see how it will look after i work my magic of inserting it in my program :)

cheers