FontColor and button - is it possible to change?
Moderator: Rathinagiri
Re: FontColor and button - is it possible to change?
Thank you Krzysztof !
Best Regards,
Nikos.
os: Windows Server 2019 - 64
Nikos.
os: Windows Server 2019 - 64
- AUGE_OHR
- Posts: 2093
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: FontColor and button - is it possible to change?
hi,
Great Work, THX
it show me how Ownerdraw with HMG work.
some Question and Comment :
in OwnButton.prg HB_FUNC( OWNBUTTONDRAW ) i saw ODS_DISABLED and ODS_FOCUS.
as it is a WC_Button it is IMHO not full State
so we got 5 State instead of 3
---
about "Round" Button : i guess Ellipse() is a GDI Function.
what about CreateEllipticRgn() Function
https://docs.microsoft.com/en-us/window ... llipticrgn
---
Great Work, THX
it show me how Ownerdraw with HMG work.
some Question and Comment :
in OwnButton.prg HB_FUNC( OWNBUTTONDRAW ) i saw ODS_DISABLED and ODS_FOCUS.
as it is a WC_Button it is IMHO not full State
Code: Select all
DO CASE
CASE nState = ODS_FOCUS + ODS_SELECTED
iStateId := PBS_PRESSED
CASE nState = ODS_FOCUS
iStateId := PBS_HOT
CASE nState = ODS_DISABLED
iStateId := PBS_DISABLED
CASE nState = ODS_GRAYED
iStateId := PBS_DISABLED
OTHERWISE
iStateId := PBS_NORMAL
ENDCASE
---
about "Round" Button : i guess Ellipse() is a GDI Function.

what about CreateEllipticRgn() Function
https://docs.microsoft.com/en-us/window ... llipticrgn
Code: Select all
DLLFUNCTION CreateEllipticRgn(nLeftRect,nTopRect,nRightRect,nBottomRect) USING STDCALL FROM GDI32.DLL
LOCAL nFrame := GetSystemMetrics(SM_CYBORDER)
hHwnd := oObj:GetHwnd()
aTmp := oObj:Currentsize()
nLeftRect := 0 +nFrame
nTopRect := aTmp[2] -nFrame
nRightRect := aTmp[1] -nFrame
nBottomRect := 0 +nFrame
// now construct a Region and call its API function
//
hRgn := CreateEllipticRgn(nLeftRect,nTopRect,nRightRect,nBottomRect)
SetWindowRgn(hHwnd,hRgn,.t.)
// clean up
//
IF .NOT. EMPTY(hRgn)
DeleteObject(hRgn)
ENDIF
have fun
Jimmy
Jimmy
- AUGE_OHR
- Posts: 2093
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: FontColor and button - is it possible to change?
hi Edward,
i have run your OwnButton Demo, GREAT
now i want to integrate it in my HMG App but have Problem ...
new Control are not in HMG "System Array" and not "visible" in Debugger.
i can not "identify" Control using
i guess i need a own "Control Array" to handle OwnButton
---
the is a Sample MYButton. how can i use Sample and modify it for OwnButton
i have run your OwnButton Demo, GREAT

now i want to integrate it in my HMG App but have Problem ...
new Control are not in HMG "System Array" and not "visible" in Debugger.

i can not "identify" Control using
Code: Select all
IF GetControlIndexByHandle( hWnd ) > 0
GetControlNameByHandle( hWnd, @cControlName, @cFormName )
hWnd :=GetControlHandle( cLabel, "Form_1" )

---
the is a Sample MYButton. how can i use Sample and modify it for OwnButton

have fun
Jimmy
Jimmy
- Claudio Ricardo
- Posts: 367
- Joined: Tue Oct 27, 2020 3:38 am
- DBs Used: DBF, MySQL, MariaDB
- Location: Bs. As. - Argentina
Re: FontColor and button - is it possible to change?
Hi All...
When i need custom button's, replace this with image and label, work fine !
(Take from "Main.prg" to my last project, and comment unnecessary lines for this sample work)
Compiled with HMG 3.4.4 32 bits.
When i need custom button's, replace this with image and label, work fine !
(Take from "Main.prg" to my last project, and comment unnecessary lines for this sample work)
Compiled with HMG 3.4.4 32 bits.
- Attachments
-
- MenuNoButton.zip
- (2.5 MiB) Downloaded 155 times
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
WhatsApp / Telegram: +54 911-63016162
- AUGE_OHR
- Posts: 2093
- Joined: Sun Aug 25, 2019 3:12 pm
- DBs Used: DBF, PostgreSQL, MySQL, SQLite
- Location: Hamburg, Germany
Re: FontColor and button - is it possible to change?
hi,
your Menu-Button are very nice.
but my Question is not only Button, it is the Sample for "own" Control.
Edwars have made those Ownerdraw Button but as i say it does not use "System Array".
MyButton Sample "fill _HMG_SYSDATA" but "where" do i add "more" like Color for Gradient ?
---
same Question with CLASS Code ... how to "fill _HMG_SYSDATA" ?
your Menu-Button are very nice.
but my Question is not only Button, it is the Sample for "own" Control.
Edwars have made those Ownerdraw Button but as i say it does not use "System Array".
MyButton Sample "fill _HMG_SYSDATA" but "where" do i add "more" like Color for Gradient ?
---
same Question with CLASS Code ... how to "fill _HMG_SYSDATA" ?
have fun
Jimmy
Jimmy
- Claudio Ricardo
- Posts: 367
- Joined: Tue Oct 27, 2020 3:38 am
- DBs Used: DBF, MySQL, MariaDB
- Location: Bs. As. - Argentina
Re: FontColor and button - is it possible to change?
Hi...
Sorry I didn't get that far in HMG yet, how to create my own controls.
For now I need to learn a lot more about HMG and its benefits.
So with image and label I simulated some.
Now I have a lot of work, but as soon as I have time, I will study the HMG libs and Win API.
Hola...
Disculpá, aún no llegue tan lejos con HMG cómo para crear mis propios controles,
mientras sigo aprendiendo cómo aprovechar todas las bondades de HMG.
Por eso simulé unos botones diferentes con "label" e "image"
Cuándo disponga de más tiempo libre, intentaré estudiar las libs y el API.
Sorry I didn't get that far in HMG yet, how to create my own controls.
For now I need to learn a lot more about HMG and its benefits.
So with image and label I simulated some.

Now I have a lot of work, but as soon as I have time, I will study the HMG libs and Win API.
Hola...
Disculpá, aún no llegue tan lejos con HMG cómo para crear mis propios controles,
mientras sigo aprendiendo cómo aprovechar todas las bondades de HMG.
Por eso simulé unos botones diferentes con "label" e "image"

Cuándo disponga de más tiempo libre, intentaré estudiar las libs y el API.
Corrige al sabio y lo harás más sabio, Corrige al necio y lo harás tu enemigo.
WhatsApp / Telegram: +54 911-63016162
WhatsApp / Telegram: +54 911-63016162