align get
align get
Hello
how do I align get right into resource
DEFINE DIALOG oDlg RESOURCE 'SV_DATA' TITLE "teste get"
REDEFINE GET oGet VAR nNota ID 101 OF oDlg
REDEFINE BUTTON oBtn ID 102 OF oDlg
ACTIVATE DIALOG oDlg CENTERED
? oGet:LRIGHT
? oGet:RIGHT
so it goes
@ 07, 28 GET nvalor OF oDlg PICTURE "999,999.99" COLORS "B/BG" SIZE 60,10 RIGHT
how do I align get right into resource
DEFINE DIALOG oDlg RESOURCE 'SV_DATA' TITLE "teste get"
REDEFINE GET oGet VAR nNota ID 101 OF oDlg
REDEFINE BUTTON oBtn ID 102 OF oDlg
ACTIVATE DIALOG oDlg CENTERED
? oGet:LRIGHT
? oGet:RIGHT
so it goes
@ 07, 28 GET nvalor OF oDlg PICTURE "999,999.99" COLORS "B/BG" SIZE 60,10 RIGHT
Marcelo Ferro da Silveira
Fwh14.04/xHarbour 1.2.3 Simplex / Bcc582 / Pelles 8
SqlLib /xMate/WS
Fwh14.04/xHarbour 1.2.3 Simplex / Bcc582 / Pelles 8
SqlLib /xMate/WS
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: align get
In the resource, you have to use style ES_RIGHT instead of style ES_LEFT.
EMG
EMG
Re: align get
Enrico Maria Giordano wrote:In the resource, you have to use style ES_RIGHT instead of style ES_LEFT.
EMG
hello Enrico!!!
I want to do at runtime
already I tried so
DEFINE DIALOG oDlg RESOURCE 'SV_DATA' TITLE "teste get"
REDEFINE GET oGet VAR nNota ID 101 OF oDlg
REDEFINE BUTTON oBtn ID 102 OF oDlg
oGet:nStyle = nOR( WS_CHILD, WS_VISIBLE,;
ES_AUTOHSCROLL,;
WS_TABSTOP ,;
WS_CLIPSIBLINGS,;
0 ,;
0 ,;
---->>>> ES_RIGHT )
ACTIVATE DIALOG oDlg CENTERED
already I tried so
ACTIVATE DIALOG oDlg ON init ( oGet:nStyle = nOR( WS_CHILD, WS_VISIBLE,;
ES_AUTOHSCROLL,;
WS_TABSTOP ,;
WS_CLIPSIBLINGS,;
0 ,;
0 ,;
---->>>> ES_RIGHT ) )
already I tried so
ACTIVATE DIALOG oDlg CENTERED ON INIT ( ChangeAlignment( Get ) )
Static Procedure ChangeAlignment( poGet )
//--Already tried
SetTextAlign( poGet:hDC, 2 ) //-- TA_RIGHT = 2
poGet:Refresh()
Return
neither functioned
Marcelo Ferro da Silveira
Fwh14.04/xHarbour 1.2.3 Simplex / Bcc582 / Pelles 8
SqlLib /xMate/WS
Fwh14.04/xHarbour 1.2.3 Simplex / Bcc582 / Pelles 8
SqlLib /xMate/WS
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: align get
You can't:marca wrote:Enrico Maria Giordano wrote:In the resource, you have to use style ES_RIGHT instead of style ES_LEFT.
EMG
hello Enrico!!!
I want to do at runtime
https://msdn.microsoft.com/en-us/librar ... s.85).aspx
EMG
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: align get
I think the only option is to destroy the control and then recreate it with the new style.
EMG
EMG
Re: align get
Enrico Maria Giordano wrote:I think the only option is to destroy the control and then recreate it with the new style.
EMG
I consulted the fiveWin manager in Brazil he said there is another way , and does not see it as today. Does anyone out there know how to do?
Marcelo Ferro da Silveira
Fwh14.04/xHarbour 1.2.3 Simplex / Bcc582 / Pelles 8
SqlLib /xMate/WS
Fwh14.04/xHarbour 1.2.3 Simplex / Bcc582 / Pelles 8
SqlLib /xMate/WS
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: align get
Have you read MS docs? They say it can't be done. Do you think MS docs are wrong? If you find a way please inform us. I'd also need to change this style on the fly.
EMG
EMG
Re: align get
Enrico Maria Giordano wrote:Have you read MS docs? They say it can't be done. Do you think MS docs are wrong? If you find a way please inform us. I'd also need to change this style on the fly.
EMG
if he answers put me here in the forum . Will Linares could not help us with that?
Marcelo Ferro da Silveira
Fwh14.04/xHarbour 1.2.3 Simplex / Bcc582 / Pelles 8
SqlLib /xMate/WS
Fwh14.04/xHarbour 1.2.3 Simplex / Bcc582 / Pelles 8
SqlLib /xMate/WS
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: align get
Have you read MS docs? They say it can't be done. Do you think MS docs are wrong? If you find a way please inform us. I'd also need to change this style on the fly.
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: align get
See this:
https://blogs.msdn.microsoft.com/oldnew ... /?p=18173/
https://blogs.msdn.microsoft.com/oldnew ... /?p=18173/
you can indeed change the alignement of an edit control at runtime. It works, therefore this blog entry is wrong.
————————————–
I wrote an MFC dialog with two buttons to modify the style of the edit control. here are the message handlers:
void CTestEditDlg::OnBnClickedButton1()
{
m_TestEdit.ModifyStyle( ES_RIGHT, ES_LEFT );
m_TestEdit.Invalidate();
}
void CTestEditDlg::OnBnClickedButton2()
{
m_TestEdit.ModifyStyle( ES_LEFT, ES_RIGHT );
m_TestEdit.Invalidate();
}
MFC’s ModifyStyle does SetWindowLong and SetWindowPos( SWP_FRAMCHANGED)
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: align get
Great! This is a sample:
EMG
Code: Select all
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg
LOCAL oGet, cVar := SPACE( 35 )
DEFINE DIALOG oDlg
@ 1, 1 GET oGet VAR cVar
@ 2, 1 BUTTON "Change style";
ACTION CHANGESTYLE( oGet )
ACTIVATE DIALOG oDlg;
CENTER
RETURN NIL
#define GWL_STYLE -16
#define SWP_FRAMECHANGED 0x0020
STATIC FUNCTION CHANGESTYLE( oGet )
SETWINDOWLONG( oGet:hWnd, GWL_STYLE, NOR( GETWINDOWLONG( oGet:hWnd, GWL_STYLE ), ES_RIGHT ) )
SETWINDOWPOS( SWP_FRAMECHANGED )
oGet:Refresh()
RETURN NIL
- Antonio Linares
- Site Admin
- Posts: 37481
- Joined: Thu Oct 06, 2005 5:47 pm
- Location: Spain
- Contact:
Re: align get
Enrico,
Is it working fine ?
Parameters for SETWINDOWPOS() are not correct
Is it working fine ?
Parameters for SETWINDOWPOS() are not correct
- Enrico Maria Giordano
- Posts: 7355
- Joined: Thu Oct 06, 2005 8:17 pm
- Location: Roma - Italia
- Contact:
Re: align get
Ops! Strangely enough, it was working. Anyway, this should be the correct version:
EMG
Code: Select all
#include "Fivewin.ch"
FUNCTION MAIN()
LOCAL oDlg
LOCAL oGet, cVar := SPACE( 35 )
DEFINE DIALOG oDlg
@ 1, 1 GET oGet VAR cVar
@ 2, 1 BUTTON "Change style";
ACTION CHANGESTYLE( oGet )
ACTIVATE DIALOG oDlg;
CENTER
RETURN NIL
#define GWL_STYLE -16
#define SWP_FRAMECHANGED 0x0020
#define SWP_NOSIZE 1
#define SWP_NOMOVE 2
STATIC FUNCTION CHANGESTYLE( oGet )
SETWINDOWLONG( oGet:hWnd, GWL_STYLE, NOR( GETWINDOWLONG( oGet:hWnd, GWL_STYLE ), ES_RIGHT ) )
SETWINDOWPOS( oGet:hWnd, , , , , , NOR( SWP_FRAMECHANGED, SWP_NOMOVE, SWP_NOSIZE ) )
oGet:Refresh()
RETURN NIL
Re: align get
Thank Linares
Marcelo Ferro da Silveira
Fwh14.04/xHarbour 1.2.3 Simplex / Bcc582 / Pelles 8
SqlLib /xMate/WS
Fwh14.04/xHarbour 1.2.3 Simplex / Bcc582 / Pelles 8
SqlLib /xMate/WS