[wxWidget] Tutorial 1 - 071102

함수명 : _T

wxChar _T(char ch)

원형 : const wxChar * _T(const wxChar ch)

This macro is exactly the same as wxT and is defined in wxWidgets simply because it may be more intuitive for Windows programmers as the standard Win32 headers also define it (as well as yet another name for the same macro which is _TEXT()).

Don't confuse this macro with _()!

 

* File Select Dialog Example

wxFileDialog dialog(            // dialog 생성과 동시에 초기화 시킨다.

this,

_T("File Open"),

wxEmptyString,

wxEmptyString,

_T("bin files (*.bin)|*.bin")

);

dialog.SetDirectory(wxGetHomeDir());    // file dialog가 열릴 위치를 지정 한다.(현재는 현재 디렉토리로 설정)

dialog.CenterOnParent();        // file diloag가 열릴 때 창의 위치 설정

 

if (dialog.ShowModal() == wxID_OK)    // file dialog를 modal형식으로 열고, 닫히고 나서의 리턴값이 OK인 경우

{

wxString info;

info.Printf(_T("Full File name : %s\n")

_T("Path : %s\n")

_T("Name : %s\n"),

dialog.GetPath().c_str(),

dialog.GetDirectory().c_str(),

dialog.GetFilename().c_str());

wxMessageDialog dialog2(this, info, _T("Selected File"));

dialog2.ShowModal();

}

* Windows Layout Tips

    * wxPanel위에 다른 위젯들을 올릴 수 있다.