Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.clipper.visual-objects > #3598

Re: Themed RTF Control

From Karl Wochele <kw@e﹐s-system.de>
Newsgroups comp.lang.clipper.visual-objects
Subject Re: Themed RTF Control
Date 2012-06-12 16:29 +0200
Message-ID <a3p222FpsjU1@mid.individual.net> (permalink)
References <jr7j9n$75p$1@dont-email.me>

Show all headers | View raw


Hi Arne,

you can try

CLASS MyRichEdit INHERIT RichEdit

METHOD Dispatch(oEvent) CLASS MyRichEdit
LOCAL liRt		AS LONGINT
LOCAL hDC		AS PTR
LOCAL rc			IS _WINRECT
LOCAL hTheme	AS PTR
LOCAL rcm		AS _WinRect

DO CASE
CASE oEvent:message == WM_NCCALCSIZE
	IF IsThemed()
		hTheme := OpenThemeData(SELF:handle(),"EDIT")
		IF hTheme <> NULL_PTR
			hDC := GetDC(SELF:Owner:handle())
			rcm := PTR(_CAST,oEvent:lParam)
			SetRect(@rc,rcm.Left,rcm.TOp,rcm.right,rcm.bottom)
			rcm.Left		:= rc.Left+1
			rcm.TOp		:= rc.TOp+1
			rcm.right	:= rc.right-GetSystemMetrics(SM_CXVSCROLL)-1
			rcm.bottom	:= rc.bottom-1
			IF _AND(SELF:dwStyle,WS_HSCROLL) = WS_HSCROLL
				rcm.bottom	:= rc.bottom-GetSystemMetrics(SM_CYHSCROLL)
			ENDIF
   	      ReleaseDC(SELF:Owner:handle(), hDC)
          CloseThemeData(hTheme)
			liRt							:= 1
			SELF:EventReturnValue	:= 0
		ENDIF
	ENDIF
   	IF liRt = 0
		liRt := SUPER:Dispatch(oEvent)
	ENDIF
CASE oEvent:message = WM_NCPAINT
	IF IsThemed()
		hTheme := OpenThemeData(SELF:handle(),"EDIT")
		IF hTheme <> NULL_PTR
			hDC := GetWindowDC(SELF:handle())
   	      GetWindowRect(SELF:handle(),@rc)
      	   rc.right		-= rc.Left
			rc.bottom	-= rc.TOp
   	      rc.Left		:= 0
			rc.TOp		:= 0
			ExcludeClipRect(hDC, rc.Left+1, rc.TOp+1, rc.right-1, rc.bottom-1)
			DrawThemeBackground(hTheme,hDC,EP_EDITTEXT,ETS_NORMAL,@rc,0)
			ReleaseDC(SELF:handle(),hDC)
          CloseThemeData(hTheme)
			liRt							:= 1
			SELF:EventReturnValue	:= 0
		ENDIF
	ENDIF
   	IF liRt = 0
		liRt := SUPER:Dispatch(oEvent)
	ENDIF
OTHERWISE
	liRt := SUPER:Dispatch(oEvent)
ENDCASE

RETURN liRt


HTH
Karl

Am 12.06.2012 16:21, schrieb Arne Ortlinghaus:
> Until now the rtf controls in my apps are displayed in the old way
> (sunken threedimensional border). Changing ws_border, ... does not
> influence the control. Has someone made changes that the border is
> rendered according to the XP themes?
>
> Arne Ortlinghaus
> ACS Data Systems

Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

Themed RTF Control "Arne Ortlinghaus" <Arne.Ortlinghaus@acs.it> - 2012-06-12 16:21 +0200
  Re: Themed RTF Control Karl Wochele <kw@e©os-system.de> - 2012-06-12 16:29 +0200
    Re: Themed RTF Control "Arne Ortlinghaus" <Arne.Ortlinghaus@acs.it> - 2012-06-13 12:02 +0200
      Re: Themed RTF Control dlzc <dlzc1@cox.net> - 2012-06-13 07:04 -0700
        Re: Themed RTF Control "Arne Ortlinghaus" <Arne.Ortlinghaus@acs.it> - 2012-06-14 12:25 +0200
          Re: Themed RTF Control Karl Faller <k.faller_withoutthat_@onlinehome.de> - 2012-06-14 12:42 +0200

csiph-web