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


Groups > comp.lang.clipper.visual-objects > #6513 > unrolled thread

Push Button background & font color

Started byWhizzwilly <whizzwilly@hotmail.co.uk>
First post2014-01-16 12:19 -0800
Last post2014-02-04 02:09 -0800
Articles 8 on this page of 28 — 13 participants

Back to article view | Back to comp.lang.clipper.visual-objects


Contents

  Push Button background & font color Whizzwilly <whizzwilly@hotmail.co.uk> - 2014-01-16 12:19 -0800
    Re: Push Button background & font color JohnMartens <martens@tennishulp.info> - 2014-01-16 21:34 +0100
      Re: Push Button background & font color Whizzwilly <whizzwilly@hotmail.co.uk> - 2014-01-16 20:06 -0800
        Re: Push Button background & font color Malcolm G <malcolm-news2012delete@delete.jobstream.com> - 2014-01-17 14:38 +0000
          Re: Push Button background & font color Whizzwilly <whizzwilly@hotmail.co.uk> - 2014-01-17 16:03 -0800
            Re: Push Button background & font color "Craig Dawson" <craig_dawson@hotmail.com> - 2014-01-18 16:49 +1100
              Re: Push Button background & font color Whizzwilly <whizzwilly@hotmail.co.uk> - 2014-01-18 11:43 -0800
                Re: Push Button background & font color "Craig Dawson" <craig_dawson@hotmail.com> - 2014-01-20 09:51 +1100
                  Re: Push Button background & font color Whizzwilly <whizzwilly@hotmail.co.uk> - 2014-01-19 17:42 -0800
                    Re: Push Button background & font color "Craig Dawson" <craig_dawson@hotmail.com> - 2014-01-20 14:46 +1100
                      Re: Push Button background & font color "Craig Dawson" <craig_dawson@hotmail.com> - 2014-01-20 14:48 +1100
                        Re: Push Button background & font color Whizzwilly <whizzwilly@hotmail.co.uk> - 2014-01-20 18:29 -0800
                  Re: Push Button background & font color Paulo Oliveira <paulo@clipinfor.com> - 2014-02-07 04:30 -0800
                    Re: Push Button background & font color "Craig Dawson" <craig_dawson@hotmail.com> - 2014-02-09 09:25 +1100
              Re: Push Button background & font color jmmicmc@gmail.com - 2014-02-11 07:25 -0800
                Re: Push Button background & font color "Craig Dawson" <craig_dawson@hotmail.com> - 2014-02-13 22:02 +1100
                  Re: Push Button background & font color "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2014-02-16 20:54 +0100
                  Re: Push Button background & font color Kuno Egger <kuno@retailsoftware.com> - 2014-03-06 23:40 -0800
                    Re: Push Button background & font color Camille Kater <katercam@pt.lu> - 2014-03-07 10:12 +0100
                      Re: Push Button background & font color Kuno Egger <kuno@retailsoftware.com> - 2014-03-07 16:44 -0800
            Re: Push Button background & font color "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2014-01-18 13:32 +0100
    Re: Push Button background & font color "Urs Eggmann" <Urs.Eggmann@shinternet.ch> - 2014-01-16 23:10 +0100
      Re: Push Button background & font color Whizzwilly <whizzwilly@hotmail.co.uk> - 2014-01-16 20:11 -0800
      Re: Push Button background & font color Whizzwilly <whizzwilly@hotmail.co.uk> - 2014-01-17 04:53 -0800
        Re: Push Button background & font color "John S." <jsommer_notthis_@alltel.net> - 2014-01-17 14:53 -0500
        Re: Push Button background & font color Karl Faller <mail_withoutthat_@_drei-f_andthat_.de> - 2014-01-17 21:48 +0100
    Re: Push Button background & font color "Fred Killet" <killet-nospam@killetsoft.de> - 2014-01-17 08:40 +0100
    Re: Push Button background & font color "richard.townsendrose" <richard.townsendrose@gmail.com> - 2014-02-04 02:09 -0800

Page 2 of 2 — ← Prev page 1 [2]


#6526

From"Urs Eggmann" <Urs.Eggmann@shinternet.ch>
Date2014-01-18 13:32 +0100
Message-ID<bjvaiqFr7jdU1@mid.individual.net>
In reply to#6524

[Multipart message — attachments visible in raw view] — view raw

Hi Paul,

I'm sorry that I didn't think of the CAVOWED.INF file... My VO is working 
for such a long time that I forgot the details of all my modifications I 
have made (so cllaed volatile memory (g))...

In your CAVOWED.INF you can add

[SupplementalFiles]
File00=yyyy.inf
File01=SomeOther.inf
;File02=Special.HKM
File03=HOVER.WED

as I did in my file. I enclose the HOVER.WED (The extension is not critical, 
they are pure ASCII files.)
Some other binary files I sent you to your mail adress because I had 
difficulties to upload them here.

Your other question:
In VO 2.7 it was not nessecary to have a return value for methods. VO 2.8 is
more stringent with the view to DotNet...
The init methods have to end with RETURN SELF,
Normal methods have RETURN NIL

If you have still more questions, please give me a mail. We will solve it!

regards
Urs


"Whizzwilly" <whizzwilly@hotmail.co.uk> schrieb im Newsbeitrag 
news:1315931e-607f-45c8-a708-85b200e4be81@googlegroups.com...
On Friday, 17 January 2014 14:38:09 UTC, Malcolm G  wrote:
> On 17/01/2014 04:06, Whizzwilly wrote:
>
> > On Thursday, 16 January 2014 20:34:19 UTC, JohnMartens  wrote:
>
> >> Does this do the job ?
>
> >>
>
> >>
>
> >>
>
> >> oMyPb:Background := Brush{Color{COLORRED}}
>
> >>
>
> >> oMyPb:TextColor := Color{COLORBLACK}
>
> >>
>
> >>
>
> >>
>
> >> John
>
> >>
>
> >>
>
> >
>
> > Hi John thanks for reply.
>
> >
>
> > This is exactly how i would like to do it and the way VO should do it.
>
>
>
> At a guess you have chosen to have windows themes enabled on these
>
> controls, and window themes can trump colour requests made by the
>
> control (I don't think that is anything to do with VO specifically
>
> more the definition of what you are asking for when to ask to enable
>
> windows themes). I am a bit rusty on this as we generally use custom
>
> draw buttons, which do choose to use the background brush.

I am using Windows XP and I have disabled the control theme and windows 
theme but still not working !! ??

Surely this is not a new problem and seems so basic that somebody must have 
a quick & easy solution. I have been sent the hover button class by Urs 
Eggman (many thanks) but i am getting compiler errors and i cant even open 
the main dialog screen in the window editor because it says error loading 
window

NAME:    PBOK
CLASS:   HOVERBUTTON
SECTION: CONTROL:TEXTCONTROL:BUTTON:PUSHBUTTON:HOVERBUTTON

Check CAVOWED.INF for supplemental files and missing entries.

How would i go about coding a custom draw button myself and how do i place 
it on my data window from within the window design editor? There will be 
approx 20 buttons per data window all which need a different color 
(background & text).

Come on all you boffins - please help !!

And just one more thing can anyone tell me any good support sites for 
downloading VO utilities & libraries i tried knowvo.com but that seems 
obsolete.

Thanks

Paul 

[toc] | [prev] | [next] | [standalone]


#6515

From"Urs Eggmann" <Urs.Eggmann@shinternet.ch>
Date2014-01-16 23:10 +0100
Message-ID<bjr3nkFlb9U1@mid.individual.net>
In reply to#6513
Hi Paul,

Check your mail. Sent you the HoverButton Class of Wiktor Stasiak.

regards
Urs

"Whizzwilly" <whizzwilly@hotmail.co.uk> schrieb im Newsbeitrag
news:6fb64df1-6e34-49a0-adbc-b363968ef24a@googlegroups.com...
> Hi all
>
> Is there any way of changing the background & font color on a push button
> ?
>
> I wish to show a screen of 10 push buttons and each button should be a
> different color depending on what category it belongs.
>
> I have searched the forum but there doesn't seem to be any clear info or
> solution to this.
>
> I am using Visual Objects 2.8 ( SP2 Build 2830 )
>
> Could anyone shed some light or point me in the right direction.
>
> Thanks
>
> Paul

[toc] | [prev] | [next] | [standalone]


#6517

FromWhizzwilly <whizzwilly@hotmail.co.uk>
Date2014-01-16 20:11 -0800
Message-ID<e6bce280-a9f9-4012-99d8-6cf49a51c287@googlegroups.com>
In reply to#6515
On Thursday, 16 January 2014 22:10:29 UTC, Urs Eggmann  wrote:
> Hi Paul,
> 
> 
> 
> Check your mail. Sent you the HoverButton Class of Wiktor Stasiak.
> 
> 
> 
> regards
> 
> Urs
> 
> 

Hi Urs

Thanks for the email - it contains some very useful info and examples.

What i would like is the ability to do this directly from within VO instead ?

Surely there must be a simple solution to this - any more ideas ?

Thanks

Paul

[toc] | [prev] | [next] | [standalone]


#6520

FromWhizzwilly <whizzwilly@hotmail.co.uk>
Date2014-01-17 04:53 -0800
Message-ID<98c03a93-dfdb-49be-8263-ebec9dc23b2a@googlegroups.com>
In reply to#6515
On Thursday, 16 January 2014 22:10:29 UTC, Urs Eggmann  wrote:
> Hi Paul,
> 
> 
> 
> Check your mail. Sent you the HoverButton Class of Wiktor Stasiak.
> 
> 
> 
> regards
> 
> Urs
> 
> 

Hi Urs

Just a quick question i have imported the aef's and compiled them and i get a lot of compiler warnings saying:-

PROCEDURE OR VOID FUNCTION/METHOD DOES NOT END WITH RETURN STATEMENT.

What are the return values ?

I also notice the following lines appear in many modules - what are they and what do they do ?

~"ONLYEARLY+" 

~"ONLYEARLY-"

Thanks

Paul

[toc] | [prev] | [next] | [standalone]


#6522

From"John S." <jsommer_notthis_@alltel.net>
Date2014-01-17 14:53 -0500
Message-ID<ad22d$52d98ab6$adbdc671$12256@ALLTEL.NET>
In reply to#6520
"Whizzwilly" <whizzwilly@hotmail.co.uk> wrote in message 
news:98c03a93-dfdb-49be-8263-ebec9dc23b2a@googlegroups.com...
> On Thursday, 16 January 2014 22:10:29 UTC, Urs Eggmann  wrote:
>> Hi Paul,
>>
>>
>>
>> Check your mail. Sent you the HoverButton Class of Wiktor Stasiak.
>>
>>
>>
>> regards
>>
>> Urs
>>
>>
>
> Hi Urs
>
> Just a quick question i have imported the aef's and compiled them and i 
> get a lot of compiler warnings saying:-
>
> PROCEDURE OR VOID FUNCTION/METHOD DOES NOT END WITH RETURN STATEMENT.
>
> What are the return values ?
>
> I also notice the following lines appear in many modules - what are they 
> and what do they do ?
>
> ~"ONLYEARLY+"
>
> ~"ONLYEARLY-"
>
> Thanks
>
> Paul
>

Hi Paul,

Under File -  Project Settings - Compile time checks for the application, 
you can "disable errors\warnings" for 51555 and 51556 to eliminate these 
warnings.

John 

[toc] | [prev] | [next] | [standalone]


#6523

FromKarl Faller <mail_withoutthat_@_drei-f_andthat_.de>
Date2014-01-17 21:48 +0100
Message-ID<sg5jd9h76s2r9aca6b87r0u96irum9p1ad@4ax.com>
In reply to#6520
Paul,
>Just a quick question i have imported the aef's and compiled them and i get a lot of compiler warnings saying:-
>
>PROCEDURE OR VOID FUNCTION/METHOD DOES NOT END WITH RETURN STATEMENT.
>
>What are the return values ?
Don't know the code, but as the warning says, it looks you have no
return statement in some methods. Add a Return Nil and they should
dissapear. This was introduced to make the code compatible with
Vulcan, which, as a dot net language, HAS to provide an explicit
"RETURN" to allow it to coexist with other languages in a dotnet
project.

>
>I also notice the following lines appear in many modules - what are they and what do they do ?
>
>~"ONLYEARLY+" 
>
>~"ONLYEARLY-"
in short, they tell the compiler to generate no latebound method stubs
for the parts between the switches. 
There Is a help entry for this ;-) with two rather in depth arcticles 

HTH
Karl

[toc] | [prev] | [next] | [standalone]


#6519

From"Fred Killet" <killet-nospam@killetsoft.de>
Date2014-01-17 08:40 +0100
Message-ID<52d8de6d$0$6558$9b4e6d93@newsspool4.arcor-online.net>
In reply to#6513
Hi Paul,

try Graphics4VO. With this library you can generate transparent, colored,
pictured and many different push buttons.
See http://www.killetsoft.de/p_gvoa_e.htm.

Kind regards,
Fred



"Whizzwilly" <whizzwilly@hotmail.co.uk> schrieb im Newsbeitrag 
news:6fb64df1-6e34-49a0-adbc-b363968ef24a@googlegroups.com...
> Hi all
>
> Is there any way of changing the background & font color on a push button 
> ?
>
> I wish to show a screen of 10 push buttons and each button should be a 
> different color depending on what category it belongs.
>
> I have searched the forum but there doesn't seem to be any clear info or 
> solution to this.
>
> I am using Visual Objects 2.8 ( SP2 Build 2830 )
>
> Could anyone shed some light or point me in the right direction.
>
> Thanks
>
> Paul 


---
Diese E-Mail ist frei von Viren und Malware, denn der avast! Antivirus Schutz ist aktiv.
http://www.avast.com

[toc] | [prev] | [next] | [standalone]


#6573

From"richard.townsendrose" <richard.townsendrose@gmail.com>
Date2014-02-04 02:09 -0800
Message-ID<55a9d385-b891-4d9c-85ed-ae067f0c745c@googlegroups.com>
In reply to#6513
hi try this ...

it works for me in vo 2830 ...

icons and text as well. its great

richard
--------------------------

TEXTBLOCK _Explain 
/*

the original idea ..

METHOD SetImage(oImage) CLASS _PushButton 
   LOCAL dwType AS DWORD 

   IF IsInstanceOf(oImage, #ICON) 
      dwType := IMAGE_ICON 
   ELSE 
      dwType := IMAGE_BITMAP 
   ENDIF 

   SendMessage(SELF:Handle(), BM_SETIMAGE, dwType, LONG(_CAST,oImage:Handle())) 

  RETURN NIL

// rgtr usage
methods required in window where button resides
---------------------------------
METHOD menucommand(oEvent) CLASS CLASS window with file getter       
	LOCAL oDirButton AS AttButton
 
  	IF  oEvent:Menu == SELF:oCCDoLocate:ContextMenu
                                                                           
		oDirButton:=SELF:oCCGetAtt    
		oDirButton:SetDir(oEvent)     // set text on button, directory, check menu item 
                                                                            
	ELSE
		SUPER:menucommand(oEvent)
	ENDIF

RETURN NIL                         
-------------------------------
ASSIGN Where(cWhere) CLASS window with file getter

	SELF:cWhere:=cWhere    
	
RETURN NIL                        
------------------------------- 
and in the class
	PROTECT cWhere:='' AS STRING
-------------------------------
and in PostInit
	LOCAL oDirButton AS ATTBUTTON

	// set the default directory
	oDirButton:=SELF:oCCDoGet
	oDirButton:SetDefault(IDM_DirSel__DirSel_C__My_Documents_Folder_ID)
-------------------------------
and in the file getter - send last used directory back	
	LOCAL oDirButton AS ATTBUTTON

	oDirButton:=SELF:oCCDoGet
	oDirButton:LastPath:=SELF:cWhere 
-------------------------------
Codes used 

A C D F G L M N P R S T W Y

  */

--------------------------

CLASS ImageButtonImageList INHERIT ImageList
	HIDDEN _oImage AS VObject
ACCESS Image CLASS ImageButtonImageList
	RETURN _oImage
METHOD INIT(oImage) CLASS ImageButtonImageList
	//PP-030915
	_oImage := oImage
	//Ueberbacher 101209: use Add() or AddMask() to add an image
	SUPER:INIT(1, oImage:Size, , _OR(ILC_COLOR32, ILC_MASK))
	RETURN SELF
CLASS ImagePushButton INHERIT PushButton
	PROTECT oMaskColor AS Color
METHOD __SetImage(oNewImage) CLASS ImagePushButton	
	LOCAL oImageList AS ImageButtonImageList
		
	IF IsThemeEnabled()
		IF IsInstanceOfUsual(oNewImage, #ICON) .OR. IsInstanceOfUsual(oNewImage, #Bitmap)
			oImageList := ImageButtonImageList{oNewImage}
			 
			IF IsInstanceOfUsual(oNewImage, #ICON)
				oImageList:Add(oNewImage)
			ELSE
				// Ueberbacher-101209: this is the way to show a bitmap transparently on a Button with XP-Style!
				oImageList:AddMask(oNewImage, oMaskColor)
			ENDIF
			
			SELF:ImageList := oImageList			
			RETURN TRUE
		ENDIF
	ENDIF

RETURN FALSE    
ASSIGN Image(oNewImage) CLASS ImagePushButton	
	LOCAL dwType 		AS DWORD
	LOCAL lStyle 		AS LONG
	LOCAL lSetStyle 	AS LONG
	LOCAL hImage 	 	AS PTR
	LOCAL oIcon 	  	AS Icon
	LOCAL oBitMap  	AS Bitmap

	lStyle := GetWindowLong(SELF:Handle(), GWL_STYLE)	      
	lStyle := _AND(lStyle, _NOT(_OR(BS_ICON,BS_BITMAP)))

	// Ueberbacher-101209: set the Button style only if there is no caption. This is the way to show text and image on a Button.
	IF Empty(cCaption)
		lStyle := _OR(lStyle, lSetStyle)
	ENDIF

	SetWindowLong(SELF:Handle(), GWL_STYLE, lStyle)
			
	IF !SELF:__SetImage(oNewImage)
		IF IsInstanceOfUsual(oNewImage, #ICON) .OR. IsInstanceOfUsual(oNewImage, #Bitmap)
			oImage := oNewImage
			
			IF IsInstanceOf(oImage, #ICON)
				dwType 		:= IMAGE_ICON
				lSetStyle 	:= BS_ICON
				oIcon		:= oNewImage
				hImage 		:= oIcon:Handle()
			ELSE
				dwType 		:= IMAGE_BITMAP
				lSetStyle 	:= BS_BITMAP
				oBitMap   	:= oNewImage  
				hImage 		:= oBitMap:Handle()
			ENDIF
	      			
			SendMessage(SELF:Handle(), BM_SETIMAGE, dwType, LONG(_CAST, hImage))
		ENDIF
	ENDIF

	RETURN oImage			
ASSIGN ImageList(oImageList) CLASS ImagePushButton	
	LOCAL sBImageList IS _winButton_ImageList
	LOCAL oImgList    AS ImageList

	IF IsInstanceOfUsual(oImageList, #ImageList)
		oImgList := oImageList
		IF IsThemeEnabled()
			sBImageList.himl   := oImgList:Handle()			
			// Ueberbacher-101209: if there is a caption, align the Button on the left
			sBImageList.uAlign := IIF(Empty(cCaption), Button_IMAGELIST_ALIGN_CENTER, BUTTON_IMAGELIST_ALIGN_LEFT)

			SendMessage(hWnd, BCM_SETIMAGELIST, 0, LONG(_CAST,@sBImageList))
		ENDIF
	ENDIF

	RETURN (oImage := oImgList)
METHOD INIT( oOwner, xID, oPoint, oDimension, cText, kStyle, lDataAware) CLASS ImagePushButton
	

	IF IsInstanceOfUsual(xID,#ResourceID)
		SUPER:Init(oOwner, xID, oPoint, oDimension, , kStyle, lDataAware)
	ELSE
		SUPER:Init(oOwner, xID, oPoint, oDimension, "Button", kStyle, lDataAware)
		IF !IsNil(cText)
			SELF:Caption := cText
		ENDIF
	ENDIF
	
	// Ueberbacher-101209 
	oMaskColor := Color{192, 192, 192}
	
	RETURN SELF
ASSIGN MaskColor(oColor) CLASS ImagePushButton
	oMaskColor := oColor
	
	RETURN NIL

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.clipper.visual-objects


csiph-web