align get

align get

Postby marca » Fri Aug 19, 2016 11:57 am

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
Marcelo Ferro da Silveira
Fwh14.04/xHarbour 1.2.3 Simplex / Bcc582 / Pelles 8
SqlLib /xMate/WS
marca
 
Posts: 116
Joined: Mon Aug 13, 2007 5:22 pm
Location: Brazil

Re: align get

Postby Enrico Maria Giordano » Fri Aug 19, 2016 12:51 pm

In the resource, you have to use style ES_RIGHT instead of style ES_LEFT.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8379
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: align get

Postby marca » Fri Aug 19, 2016 1:00 pm

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
marca
 
Posts: 116
Joined: Mon Aug 13, 2007 5:22 pm
Location: Brazil

Re: align get

Postby Enrico Maria Giordano » Fri Aug 19, 2016 1:06 pm

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


You can't:

https://msdn.microsoft.com/en-us/library/windows/desktop/bb775464(v=vs.85).aspx

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8379
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: align get

Postby Enrico Maria Giordano » Fri Aug 19, 2016 1:09 pm

I think the only option is to destroy the control and then recreate it with the new style.

EMG
User avatar
Enrico Maria Giordano
 
Posts: 8379
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: align get

Postby marca » Fri Aug 19, 2016 2:15 pm

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
marca
 
Posts: 116
Joined: Mon Aug 13, 2007 5:22 pm
Location: Brazil

Re: align get

Postby Enrico Maria Giordano » Fri Aug 19, 2016 2:19 pm

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
User avatar
Enrico Maria Giordano
 
Posts: 8379
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: align get

Postby marca » Fri Aug 19, 2016 3:10 pm

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
marca
 
Posts: 116
Joined: Mon Aug 13, 2007 5:22 pm
Location: Brazil

Re: align get

Postby Antonio Linares » Mon Aug 22, 2016 6:18 am

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.
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41413
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: align get

Postby Antonio Linares » Mon Aug 22, 2016 6:25 am

See this:

https://blogs.msdn.microsoft.com/oldnewthing/20090525-00/?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)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41413
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: align get

Postby Enrico Maria Giordano » Mon Aug 22, 2016 8:13 am

Great! This is a sample:

Code: Select all  Expand view
#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


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8379
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: align get

Postby Antonio Linares » Mon Aug 22, 2016 8:28 am

Enrico,

Is it working fine ?

Parameters for SETWINDOWPOS() are not correct
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 41413
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: align get

Postby Enrico Maria Giordano » Mon Aug 22, 2016 8:52 am

Ops! Strangely enough, it was working. Anyway, this should be the correct version:

Code: Select all  Expand view
#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


EMG
User avatar
Enrico Maria Giordano
 
Posts: 8379
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: align get

Postby marca » Mon Aug 22, 2016 11:22 am

Thank Linares
Marcelo Ferro da Silveira
Fwh14.04/xHarbour 1.2.3 Simplex / Bcc582 / Pelles 8
SqlLib /xMate/WS
marca
 
Posts: 116
Joined: Mon Aug 13, 2007 5:22 pm
Location: Brazil


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 48 guests