Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.clipper.visual-objects > #11846
| From | Fred Killet <info_nospam_@killetsoft.de> |
|---|---|
| Newsgroups | comp.lang.clipper.visual-objects |
| Subject | Re: Graphics4VO Push Button |
| Date | 2018-08-26 01:44 +0200 |
| Organization | Killet Software Ing.-GbR |
| Message-ID | <plspkv$16e$1@news.albasani.net> (permalink) |
| References | <994a48b6-e8bd-4b5c-a6ec-48c0e7301afe@googlegroups.com> |
Am 25.08.2018 um 15:35 schrieb ZodcomagGmbH@yahoo.com:
> I tried to understand from the example how to make a colored bush button.
>
> I inherited the oCCPushButton from gFormPushButton
> In the PostInit of the window:
> self:oCCPushButton:setForm(G_FORMRECTANGLE)
> self:oCCPushButton:setBackGroundColor(Color{255,0,0})
>
> I get an error: "setBackGroundColor is not a method of class gFormPushButton".
>
> Well, I think setBackGroundColor is a method of gFormPushButton, and the example use this method.
>
> What am I missing?
>
> Henry
>
Hi Henry,
you bought the source code of Graphics4VO. If you would read the
documentation you would find the interface of the class gFormPushButton.
Here is described, that a method setBackColor() exists for setting the
background color (not setBackGroundColor). There you find also an
Example for a dynamic created formatted PushButton:
-----------------------------------
CLASS gFormPushButton INHERIT PushButton
Creates a formatted PushButton that can be put on graphic windows and on
DataWindow and DialogWindow.
Inherits from: PushButton
A detailed description of this class and derived classes is available in
CAVO online help. All methods and instance variables of this class can be
used in a regular way.
Methods:
init() Creates an instance of the class
setForm() Changes the shape of the formatted PushButton
setStretch() Switches stretching of bitmaps and icons on or off
setBackColor() Sets a color for the background of the formatted
PushButton
Remarks:
The formatted PushButton has a look like standard PushButtons, but it can
be displayed as circle, ellipse, cartouche, rounded rectangle and rectangle.
The PushButton can contain a centered icon or bitmap and / or a centered
single or multiline text. PushButtons bitmap or icon can be combined with
the text output or the text can be displayed alone. The background of the
PushButton can be displayed standard gray or collorde. Text can be displayed
standard black or colored.
Formatted PushButtons of the class gFormPushButton may be used on graphical
Windows of the Graphics4VO library and on DataWindow and DialogWindow.
Formatted PushButtons can be created dynamically or are created in the
Visual Objects "Editor Window" as "Push Button" (See Sample Program). In
the editor window "Push Button Properties" the field "Inherit from Class"
must be entered with the class gFormPushButton. All other fields in the
"Push Button Properties" window, including those for displaying icons and
bitmaps, can be set in the usual manner. Formatted PushButtons can not be
printed.
Eample for a dynamic created formatted PushButton:
CLASS winGraphChild INHERIT gChildAppWindow
PROTECT _oFormPush AS gFormPushButton
METHOD Init(oOwner) CLASS winGraphChild
LOCAL oFont AS font
oFont := Font{FONTSWISS,9}
oFont:Bold := TRUE
SELF:_oFormPush := gFormPushButton{SELF,1111,point{0,0},;
dimension{100,25},,,G_FORMCIRCLE}
SELF:_oFormPush:HyperLabel := HyperLabel{#butBeep,"Beep!",;
NULL_STRING,NULL_STRING}
SELF:_oFormPush:Font(oFont,FALSE)
SELF:_oFormPush:show()
RETURN SELF
METHOD butBeep() CLASS winGraphChild
tone(300,2)
RETURN SELF
METHOD expose(oEvent) CLASS winGraphChild
STATIC LOCAL nX AS SHORT
SUPER:expose(oEvent)
IF SELF:IsVisible()
SELF:_oFormPush:origin := point{20,20}
ENDIF
RETURN SELF
METHOD paint() CLASS winGraphChild
LOCAL nWinW,nWinH AS WORD
SELF:_oGraphics:setBackgroundColor(G_COLORLIGHTCYAN)
SELF:_oGraphics:paintGradientCanvas(10,G_DIRECTIONDOWN)
nWinW := SELF:_oGraphics:getDeviceWidth()
nWinH := SELF:_oGraphics:getDeviceHeight()
SELF:_oGraphics:setWorldOrigin(nWinW / 2, nWinH / 2)
SELF:_oGraphics:setStringFont(G_FONTTYPEROMAN,40,120,G_FONTBOLD,;
G_FONTDIMFLEX,0.0)
SELF:_oGraphics:setStringColor(G_COLORWHITE)
SELF:_oGraphics:setStringShadow(6,G_COLORBLACK,G_DIRECTIONRIGHTDOWN)
SELF:_oGraphics:paintStringShadow(0,nWinH * 0.2,"KilletSoft",G_ORIGINCENTER)
RETURN SELF
-----------------------------------
Back to comp.lang.clipper.visual-objects | Previous | Next — Previous in thread | Find similar | Unroll thread
Graphics4VO Push Button ZodcomagGmbH@yahoo.com - 2018-08-25 06:35 -0700 Re: Graphics4VO Push Button Fred Killet <info_nospam_@killetsoft.de> - 2018-08-26 01:44 +0200
csiph-web