Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #7776 > unrolled thread
| Started by | Paulo Oliveira <paulo@clipinfor.com> |
|---|---|
| First post | 2015-02-24 07:17 -0800 |
| Last post | 2015-03-03 10:29 +0100 |
| Articles | 2 — 2 participants |
Back to article view | Back to comp.lang.clipper.visual-objects
alphablend in fixedtext Paulo Oliveira <paulo@clipinfor.com> - 2015-02-24 07:17 -0800
Re: alphablend in fixedtext "Arne Ortlinghaus" <Arne.Ortlinghaus@acs.it> - 2015-03-03 10:29 +0100
| From | Paulo Oliveira <paulo@clipinfor.com> |
|---|---|
| Date | 2015-02-24 07:17 -0800 |
| Subject | alphablend in fixedtext |
| Message-ID | <88ab84c7-96e3-4187-b7da-2eb495a5dda7@googlegroups.com> |
Hi All,
It is possible apply AlphaBend() function to FixedText control?
I have AlphaBendRatio in the selector of bBrowser, and i have a control to display the legend of colors.
My problem is the control don't have AlphaBendRatio and the colors don't match with the bBrowser Selector, my control is:
CLASS PoFixedTextLegenda INHERIT FixedText
PROTECT oFT AS FixedText
PROTECT nOwneralignment AS LONG
METHOD ColocaQuadro() AS VOID PASCAL CLASS PoFixedTextLegenda
LOCAL oPoint AS Point
LOCAL oPoint2 AS Point
LOCAL oDim AS Dimension
oPoint := PClone(SELF:origin)
oDim := PClone(SELF:size)
oDim:width := oDim:height
SELF:OFT := FixedText{SELF:Owner,-1,oPoint,oDim,""}
//SELF:oFT:SetExStyle( WS_EX_DLGMODALFRAME, TRUE )
SELF:oFT:SetExStyle( WS_EX_STATICEDGE, TRUE )
//Now it's Work
SetWindowPos(SELF:oFT:Handle(), NULL_PTR, 0, 0, 0, 0, ;
_OR(SWP_FRAMECHANGED + SWP_NOMOVE + ;
SWP_NOOWNERZORDER + SWP_NOSIZE ))
SELF:oFT:Background:=Brush{color{COLORRED}} //Default
//Adjust the placement of the Legenda (oFT)
//oPoint:x := oPoint:x - oDim:width
SELF:OFT:Origin := oPoint
oPoint2:=PClone(SELF:Origin)
oPoint2:x+=17
SELF:Origin:=oPoint2
//Resize the parent FixedText
SetWindowPos(SELF:handle(),0L,oPoint:x,0,SELF:size:width-oDim:Width,SELF:size:height,SWP_NOMOVE+0x14)
SELF:ShowControl()
RETURN
METHOD Hide() CLASS PoFixedTextLegenda
SUPER:Hide()
SELF:oFt:Hide()
METHOD Init(oOwner, nId, oPoint, oDim, lDataAware ) CLASS PoFixedTextLegenda
SUPER:Init(oOwner, nId, oPoint, oDim, lDataAware )
SELF:SetStyle(SS_CENTERIMAGE,TRUE)
SetWindowPos(SELF:Handle(), NULL_PTR, 0, 0, 0, 0, ;
_OR(SWP_FRAMECHANGED + SWP_NOMOVE + ;
SWP_NOOWNERZORDER + SWP_NOSIZE ))
IF SELF:nOwneralignment <> OA_NO
SELF:Owneralignment := SELF:nOwneralignment
ENDIF
SELF:ColocaQuadro()
ASSIGN LegendaBKGround(uBrush) AS PASCAL CLASS PoFixedTextLegenda
Default(@uBrush,Brush{Color{COLORRED}})
RETURN SELF:oFT:Background:=uBrush
ASSIGN OwnerAlignment(iNewVal) CLASS PoFixedTextLegenda
IF !IsInstanceOf(oFormSurface, #Window) .or. !IsInstanceOf(oParent, #Window)
SELF:nOwneralignment := OA_NO
RETURN OA_NO
ELSEIF IsInstanceOf(oFormSurface, #Window)
oFormSurface:__AddAlign(SELF, iNewVal)
IF SELF:OFT <> NULL_OBJECT
oFormSurface:__AddAlign(SELF:OFT,iNewVal)
ENDIF
ELSE
oParent:__AddAlign(SELF, iNewVal)
IF SELF:OFT <> NULL_OBJECT
oParent:__AddAlign(SELF:OFT,iNewVal)
ENDIF
ENDIF
SELF:nOwneralignment := iNewVal
RETURN NIL
METHOD Show() CLASS PoFixedTextLegenda
SUPER:Show()
SELF:oFt:Show()
METHOD ShowControl() CLASS PoFixedTextLegenda
IF SELF:OFT <> NULL_OBJECT
IF SELF:IsVisible()
SELF:OFT:show()
ELSE
SELF:OFT:Hide()
ENDIF
IF !IsWindowEnabled(SELF:handle())
SELF:OFT:disable()
ENDIF
ENDIF
Some Help?
Paulo
[toc] | [next] | [standalone]
| From | "Arne Ortlinghaus" <Arne.Ortlinghaus@acs.it> |
|---|---|
| Date | 2015-03-03 10:29 +0100 |
| Message-ID | <md3us0$djo$1@dont-email.me> |
| In reply to | #7776 |
Hi Paulo,
I do not know if it works.
But alphablending of two RGB background colors can done also by yourself.
The functions for calculating the resulting RGB can be found in Internet.
Using the Windows alphablending is interesting only if the foreground is
alpha blended, that means semi transparent and not opaque as usually.
Arne
"Paulo Oliveira" <paulo@clipinfor.com> schrieb im Newsbeitrag
news:88ab84c7-96e3-4187-b7da-2eb495a5dda7@googlegroups.com...
> Hi All,
>
> It is possible apply AlphaBend() function to FixedText control?
>
> I have AlphaBendRatio in the selector of bBrowser, and i have a control to
> display the legend of colors.
> My problem is the control don't have AlphaBendRatio and the colors don't
> match with the bBrowser Selector, my control is:
>
> CLASS PoFixedTextLegenda INHERIT FixedText
> PROTECT oFT AS FixedText
> PROTECT nOwneralignment AS LONG
> METHOD ColocaQuadro() AS VOID PASCAL CLASS PoFixedTextLegenda
> LOCAL oPoint AS Point
> LOCAL oPoint2 AS Point
> LOCAL oDim AS Dimension
>
> oPoint := PClone(SELF:origin)
> oDim := PClone(SELF:size)
> oDim:width := oDim:height
> SELF:OFT := FixedText{SELF:Owner,-1,oPoint,oDim,""}
> //SELF:oFT:SetExStyle( WS_EX_DLGMODALFRAME, TRUE )
> SELF:oFT:SetExStyle( WS_EX_STATICEDGE, TRUE )
>
>
>
> //Now it's Work
> SetWindowPos(SELF:oFT:Handle(), NULL_PTR, 0, 0, 0, 0, ;
> _OR(SWP_FRAMECHANGED + SWP_NOMOVE + ;
> SWP_NOOWNERZORDER + SWP_NOSIZE ))
>
> SELF:oFT:Background:=Brush{color{COLORRED}} //Default
> //Adjust the placement of the Legenda (oFT)
> //oPoint:x := oPoint:x - oDim:width
> SELF:OFT:Origin := oPoint
> oPoint2:=PClone(SELF:Origin)
> oPoint2:x+=17
> SELF:Origin:=oPoint2
> //Resize the parent FixedText
>
> SetWindowPos(SELF:handle(),0L,oPoint:x,0,SELF:size:width-oDim:Width,SELF:size:height,SWP_NOMOVE+0x14)
> SELF:ShowControl()
> RETURN
> METHOD Hide() CLASS PoFixedTextLegenda
> SUPER:Hide()
> SELF:oFt:Hide()
>
> METHOD Init(oOwner, nId, oPoint, oDim, lDataAware ) CLASS
> PoFixedTextLegenda
> SUPER:Init(oOwner, nId, oPoint, oDim, lDataAware )
> SELF:SetStyle(SS_CENTERIMAGE,TRUE)
> SetWindowPos(SELF:Handle(), NULL_PTR, 0, 0, 0, 0, ;
> _OR(SWP_FRAMECHANGED + SWP_NOMOVE + ;
> SWP_NOOWNERZORDER + SWP_NOSIZE ))
>
> IF SELF:nOwneralignment <> OA_NO
> SELF:Owneralignment := SELF:nOwneralignment
> ENDIF
>
> SELF:ColocaQuadro()
>
> ASSIGN LegendaBKGround(uBrush) AS PASCAL CLASS PoFixedTextLegenda
> Default(@uBrush,Brush{Color{COLORRED}})
> RETURN SELF:oFT:Background:=uBrush
>
> ASSIGN OwnerAlignment(iNewVal) CLASS PoFixedTextLegenda
> IF !IsInstanceOf(oFormSurface, #Window) .or. !IsInstanceOf(oParent,
> #Window)
> SELF:nOwneralignment := OA_NO
> RETURN OA_NO
> ELSEIF IsInstanceOf(oFormSurface, #Window)
> oFormSurface:__AddAlign(SELF, iNewVal)
> IF SELF:OFT <> NULL_OBJECT
> oFormSurface:__AddAlign(SELF:OFT,iNewVal)
> ENDIF
> ELSE
> oParent:__AddAlign(SELF, iNewVal)
> IF SELF:OFT <> NULL_OBJECT
> oParent:__AddAlign(SELF:OFT,iNewVal)
> ENDIF
> ENDIF
>
> SELF:nOwneralignment := iNewVal
>
> RETURN NIL
> METHOD Show() CLASS PoFixedTextLegenda
> SUPER:Show()
>
> SELF:oFt:Show()
> METHOD ShowControl() CLASS PoFixedTextLegenda
> IF SELF:OFT <> NULL_OBJECT
> IF SELF:IsVisible()
> SELF:OFT:show()
> ELSE
> SELF:OFT:Hide()
> ENDIF
> IF !IsWindowEnabled(SELF:handle())
> SELF:OFT:disable()
> ENDIF
> ENDIF
>
> Some Help?
>
> Paulo
[toc] | [prev] | [standalone]
Back to top | Article view | comp.lang.clipper.visual-objects
csiph-web