Text Alignment, how is it handled ?

George Ginden ginden at email.com
Mon Feb 7 09:07:06 CST 2005


Hi the following code part is not working in Wine as it work (as 
supposed) in Windows.

HRight = GetDlgItem (hDlg,IDC_RIGHT);
Edit_SetText(HRight, "Right");

How is text alignment, in a edit field, handled ?
It looks like the Edit_SetText function is mapped to SetWindowText, 
which calls X11DRV_SetWindowText...
But again, text alignment doesn't work.

Can I do something ?

PS: c source code is attacched

Regards.

-------------- next part --------------
/*                                                        
**   Ditta..........:TeamSystem spa
**   Programmatore..:Stefano Peraldini
**   Nome programma.:Test Wine
**   Data...........:04/02/2005
**
*/

//INCLUDE
#include <windows.h>
#include <WindowsX.h>
#include "resource.h"

//VARIABILI GLOBALI
HWND hUnaligned, HCenter, HRight;
HDC hdc;

//PROTOTIPI
BOOL CALLBACK DlgProc (HWND, UINT, WPARAM, LPARAM);

//MAIN
int WINAPI
WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
{
	// Visualizzazione e controllo errore visualizzazione dialog
	if (DialogBox (hInstance, (LPCSTR) IDD_DIALOG1, NULL, DlgProc) == -1)
		MessageBox (NULL, "Errore visualizzazione dialog!!","Test Wine", MB_ICONQUESTION | MB_OK);
	return 0;
}

//DLGPROC della dialog1
BOOL CALLBACK
DlgProc (HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam)
{
	//Switch per la gestione dei messaggi provenienti dalla dialog1
	switch (message) {
		//Gestione del VM_CLOSE
		case WM_CLOSE:
			return TRUE;
			break;
		//Impostazione dialog1
		case WM_INITDIALOG:
			{
				hUnaligned = GetDlgItem (hDlg,IDC_UNALIGNED);
				HCenter = GetDlgItem (hDlg,IDC_CENTER);
				HRight = GetDlgItem (hDlg,IDC_RIGHT);
				//Edit Box Unaligned
				Edit_SetText(hUnaligned, "Unaligned");
				//Edit Box Center
				Edit_SetText(HCenter, "Center");
				//Edit Box Right
				Edit_SetText(HRight, "Right");
				return TRUE;
			}
		//Gestione messaggi dialog1
		case WM_COMMAND:
			switch (LOWORD (wParam)) 
			{
				case IDOK:
					EndDialog (hDlg, 0);
					return TRUE;
				break;	// END WMCOMMAND
			}
			return FALSE;
	}
	return FALSE;
}



More information about the wine-devel mailing list