Beispiel #1
0
//MB_YESNOCANCEL
static VOID CreateYesNoCancel(HANDLE hWnd,__MESSAGE_BOX* pMsgBox)
{
	int x,y;
	x = pMsgBox->dwMsgBoxWidth - MSGBOX_BUTTON_WIDTH * 3;  //3 buttons.
	x -= MSGBOX_BUTTON_SPACE * 2;  //Skip the space between these 3 buttons.
	x /= 2;
	y = pMsgBox->dwMsgBoxHeight - 10 - GlobalParams.dwWndCaptionHeight;
	y -= MSGBOX_BUTTON_HEIGHT;
	if(y < 0)
	{
		y = 0;
	}
	//Create first button.
	CreateButton(hWnd,"是(Y)",ID_YES,x,y,MSGBOX_BUTTON_WIDTH,MSGBOX_BUTTON_HEIGHT);
	x += MSGBOX_BUTTON_WIDTH;
	x += MSGBOX_BUTTON_SPACE;
	//Create the second button.
	CreateButton(hWnd,"否(N)",ID_NO,x,y,MSGBOX_BUTTON_WIDTH,MSGBOX_BUTTON_HEIGHT);
	x += MSGBOX_BUTTON_WIDTH;
	x += MSGBOX_BUTTON_SPACE;
	//Create the third button.
	CreateButton(hWnd,"取消(C)",ID_CANCEL,x,y,MSGBOX_BUTTON_WIDTH,MSGBOX_BUTTON_HEIGHT);

	return;
}
Beispiel #2
0
MainForm::MainForm()
{
    SuspendLayout();

    _humanBoard = gcnew Board();
    _computerBoard = gcnew Board(false);

    _humanPlayer = gcnew HumanPlayer("Þaidëjas", _computerBoard);
    _computerPlayer = gcnew ComputerPlayer("Kompiuteris");


    _scoreboard = gcnew ScoreBoard(_humanPlayer, _computerPlayer, 10, 100);
    _controller = gcnew GameController(_humanPlayer, _computerPlayer, _humanBoard, _computerBoard, _scoreboard);

    _shuffleButton = CreateButton(ShuffleCharacter.ToString(), ButtonBackColor);
    _newGameButton = CreateButton(NewGameCharacter.ToString(), ButtonBackColor);
    _startGameButton = CreateButton(StartGameCharacter.ToString(), ButtonBackColor);

    SetupWindow();
    LayoutControls();

    _scoreboard->GameEnded += gcnew EventHandler(this, &MainForm::OnGameEnded);

    _shuffleButton->Click += gcnew System::EventHandler(this, &MainForm::OnShuffleButtonClick);
    _startGameButton->Click += gcnew System::EventHandler(this, &MainForm::OnStartGameButtonClick);
    _newGameButton->Click += gcnew System::EventHandler(this, &MainForm::OnNewGameButtonClick);

    ResumeLayout();

    StartNewGame();
};
Beispiel #3
0
void create_points_frame(void *data)
{
    set_wait_cursor();
    
    if (points_frame == NULL) {
        Widget dialog, wbut, rc, fr;
        
	points_frame = CreateDialogForm(app_shell, "Point explorer");
	
	fr = CreateFrame(points_frame, NULL);
        AddDialogFormChild(points_frame, fr);
	locate_point_message = CreateLabel(fr, "Point explorer");
        
        dialog = CreateVContainer(points_frame);
        AddDialogFormChild(points_frame, dialog);

        track_set_sel = CreateSetChoice(dialog,
            "Restrict to set:", LIST_TYPE_SINGLE, TRUE);
        AddListChoiceCB(track_set_sel, track_set_cbproc, NULL);
        
	rc = CreateHContainer(dialog);
	goto_index_item = CreateTextItem(rc, 6, "Point location:");
	wbut = CreateButton(rc, "Goto point");
	AddButtonCB(wbut, do_gotopt_proc, NULL);

	locate_point_item = CreateTextInput(dialog, "Point data:");

	CreateSeparator(dialog);

	rc = CreateHContainer(dialog);

	wbut = CreateButton(rc, "Track");
	AddButtonCB(wbut, do_track_proc, NULL);

	wbut = CreateButton(rc, "Move");
	AddButtonCB(wbut, do_ptsmove_proc, (void *) MOVE_POINT_XY);
	wbut = CreateButton(rc, "Move X");
	AddButtonCB(wbut, do_ptsmove_proc,  (void *) MOVE_POINT_X);
	wbut = CreateButton(rc, "Move Y");
	AddButtonCB(wbut, do_ptsmove_proc,  (void *) MOVE_POINT_Y);

	wbut = CreateButton(rc, "Prepend");
	AddButtonCB(wbut, do_add_proc, (void *) ADD_POINT_BEGINNING);
	wbut = CreateButton(rc, "Append");
	AddButtonCB(wbut, do_add_proc, (void *) ADD_POINT_END);
	wbut = CreateButton(rc, "Insert");
	AddButtonCB(wbut, do_add_proc, (void *) ADD_POINT_NEAREST);

	wbut = CreateButton(rc, "Delete");
	AddButtonCB(wbut, do_del_proc, NULL);

	wbut = CreateButton(rc, "Close");
	AddButtonCB(wbut, points_done_proc, (void *) points_frame);
        
        ManageChild(points_frame);
    }
    
    RaiseWindow(GetParent(points_frame));
    unset_wait_cursor();
}
void CInstaller::InitButtonSection(GtkWidget *parentbox)
{
    GtkWidget *hbox = gtk_hbox_new(FALSE, 0);
    
    GtkWidget *buttonbox = gtk_hbutton_box_new();
    
    m_pCancelLabel = gtk_label_new(GetTranslation("Cancel"));
    m_pCancelButton = CreateButton(m_pCancelLabel, GTK_STOCK_CANCEL);
    g_signal_connect(G_OBJECT(m_pCancelButton), "clicked", G_CALLBACK(CancelCB), this);
    gtk_box_pack_start(GTK_BOX(buttonbox), m_pCancelButton, FALSE, FALSE, 5);
    
    gtk_box_pack_start(GTK_BOX(hbox), buttonbox, FALSE, FALSE, 5);
    
    buttonbox = gtk_hbutton_box_new();
    gtk_box_set_spacing(GTK_BOX(buttonbox), 15);
    
    m_pBackLabel = gtk_label_new(GetTranslation("Back"));
    m_pBackButton = CreateButton(m_pBackLabel, GTK_STOCK_GO_BACK);
    g_signal_connect(G_OBJECT(m_pBackButton), "clicked", G_CALLBACK(BackCB), this);
    gtk_box_pack_end(GTK_BOX(buttonbox), m_pBackButton, FALSE, FALSE, 5);

    m_pNextLabel = gtk_label_new(GetTranslation("Next"));
    m_pNextButton = CreateButton(m_pNextLabel, GTK_STOCK_GO_FORWARD);
    g_signal_connect(G_OBJECT(m_pNextButton), "clicked", G_CALLBACK(NextCB), this);
    gtk_box_pack_end(GTK_BOX(buttonbox), m_pNextButton, FALSE, FALSE, 5);

    gtk_box_pack_end(GTK_BOX(hbox), buttonbox, FALSE, FALSE, 5);
    
    gtk_box_pack_start(GTK_BOX(parentbox), hbox, FALSE, FALSE, GetMainSpacing());
}
Beispiel #5
0
void OnCreate(HWND hwnd)
{
	g_btOpen = CreateButton(hwnd, _T("V"), 0, 0, 20, 20);
	g_btPlay = CreateButton(hwnd, _T("|>"), 20, 0, 20, 20);
	g_btPause = CreateButton(hwnd, _T("||"), 40, 0, 20, 20);
	g_btStop = CreateButton(hwnd, _T("[]"), 60, 0, 20, 20);
	g_stTime = CreateStatic(hwnd, _T("00:00"), 0, 20, 60, 20);
	g_sbTime = CreateScrollBar(hwnd, 60, 20, 220, 20);
	g_hPanel = CreateStatic(hwnd, _T(""), 0, 40, 300, 200);
#ifndef WINCE
	DragAcceptFiles(hwnd, true);
#endif
	CWindowsDataSourceFactory::Register();
	CDefaultMediaSourceFactory::Register();
	CDefaultDecoderFactory::Register();
	CWindowsRendererFactory::Register();
	g_pGoodlayer = new CGoodPlayer();
	g_pPlayer = new CMediaPlayer(g_hPanel);
	g_pPlayer->SetPlayerListener(g_pGoodlayer);
	g_pPlayer->LoadConfig(_T("GoodPlayer.cfg"));
	g_nDuration = 0;

	EnableWindow(g_btPlay, false);
	EnableWindow(g_btPause, false);
	EnableWindow(g_btStop, false);
}
Beispiel #6
0
int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmdLine, int nCmdShow)
{
    XInitXCGUI();
	
    HWINDOW hWindow = XWnd_Create(0, 0, 300, 200, L"ìŲʽçÃæ¿â´°¿Ú",NULL, xc_window_style_default);
    XBtn_SetType(XBtn_Create(10, 5, 60, 20,L"close",hWindow),button_type_close);
	
    my_image_info  info;
    info.hImage1=XImage_LoadFile(L"1.png");
    info.hImage2=XImage_LoadFile(L"2.png");
    info.hImage3=XImage_LoadFile(L"3.png");
    info.hImage4=XImage_LoadFile(L"4.png");
    info.hImage5=XImage_LoadFile(L"5.png");
    info.hImage6=XImage_LoadFile(L"6.png");
	
    int left=20;
    int top=50;
    CreateButton(left,top,&info,hWindow); left+=50;
    CreateButton(left,top,&info,hWindow); left+=50;
    CreateButton(left,top,&info,hWindow); left+=50;
    CreateButton(left,top,&info,hWindow); left+=50;
    CreateButton(left,top,&info,hWindow); left+=50;
	
    left=20; top=100;
    CreateButtonLoop(left,top,&info,hWindow); left+=50;
    CreateButtonLoop(left,top,&info,hWindow); left+=50;
    CreateButtonLoop(left,top,&info,hWindow); left+=50;
    CreateButtonLoop(left,top,&info,hWindow); left+=50;
    CreateButtonLoop(left,top,&info,hWindow); left+=50;
	
    XWnd_ShowWindow(hWindow,SW_SHOW);
    XRunXCGUI();
    XExitXCGUI();
    return 0;
}
void CKSUsername_And_Password_Pane::Init()
{

	
	mpPane = ge::IPane::Create();
	mpPane->SetSize(ge::SSize(320,245));
	
	tint32 iPosY = 0;
	CreateBitmap(ge::IControl::giNoID, IDB_Back_Sign_In, ge::SPos(0, 0)); iPosY += 60;
	
	
	
	
	
	// user name
	mpUser_Name_Txt = CreateDisplay(giCtrl_User_Name_Display, 
									ge::SPos(23, 32),  
									ge::SSize(197, 16), 
									CreateFont(Generic128, IDF_Font_Fuxley_712, ge::SRGB(10, 10, 10)),
									true);
	
	mpUser_Name_Txt->SetHorzAlignment(ge::IText::HorzAlignLeft);
	mpUser_Name_Txt->SetClicksOutsideAsSuccess();
	
	
	// password
	mpPassword_Txt = CreateDisplay(giCtrl_Password_Display, 
									ge::SPos(23, 32+42),  
									ge::SSize(197, 16), 
									CreateFont(Generic128, IDF_Font_Fuxley_712, ge::SRGB(10, 10, 10)),
									true);
	
	mpPassword_Txt->SetHorzAlignment(ge::IText::HorzAlignLeft);
	mpPassword_Txt->SetClicksOutsideAsSuccess();
	mpPassword_Txt->SetPassword();
	
	
	
	
	
	
	
	
	// remember username and password
	mpRemember_Me_Button = Create2StateButton(giCtrl_Remember_Me, IDB_Button_Remember_Me, ge::SPos(23, 105), false);
	
	// cancel button
	CreateButton(giCtrl_Username_And_Password_Cancel, IDB_Button_Cancel, ge::SPos(119, 149), false);
	
	// ok button
	CreateButton(giCtrl_Username_And_Password_OK, IDB_Button_OK, ge::SPos(180, 149), false);
	
	
	
	
}
void CKSImportGUIPane::Init()
{
    mpPane = ge::IPane::Create();
    mpPane->SetSize(ge::SSize(424,424));
    CreateBitmap(ge::IControl::giNoID, IDB_Back_Import, ge::SPos(0, 0));

    mpPop = NULL;

    //-------------------------------------------------
    // Scroll pane viewing the content in a "Folder"
    mpImport_File_Browser = new CKS_Import_File_Browser(this, GetGUI());
    mpImport_File_Browser->SetInfo();
    mpImport_File_Browser->Init();
    mpPane->AddControl(mpImport_File_Browser->GetPane(), ge::SPos(8, 39));
    Create_File_Browser_ScrollBar();

    //-------------------------------------------------
    // Scroll pane viewing a list of files to add to te project
    mpImport_Files = new CKS_Import_Files(this, GetGUI());
    mpImport_Files->SetInfo();
    mpImport_Files->Init();
    mpPane->AddControl(mpImport_Files->GetPane(), ge::SPos(216, 39));
    Create_File_ScrollBar();


    CreateButton(giCtrl_Remove_Import, IDB_Button_Move, ge::SPos(195, 345), false);
    CreateButton(giCtrl_Add_Import, IDB_Button_Add, ge::SPos(195, 369), false);
    // Stop
    CreateButton(giCtrl_Stop_Import, IDB_Button_Stop, ge::SPos(195, 369+24), false);
    // Play
    Create2StateButton(giCtrl_Play_Import, IDB_Button_Play, ge::SPos(195+28, 369+24), true);


    // Cancel / Export
    CreateButton(giCtrl_Cancel_Import, IDB_Button_Cancel, ge::SPos(292, 400), false);
    CreateButton(giCtrl_Import, IDB_Button_Import, ge::SPos(292 + 64, 400), false);

    tchar psz[1024];
    CKSPlugIn* pPlugIn = dynamic_cast<CKSPlugIn*>(GetPlugIn());
    //IFile::GetSystemDirectory(IFile::SystemDirDesktop, psz);
    pPlugIn->GetDefaultProjectFolder(psz);
    BrowseToDir(std::string(psz));

    dynamic_cast<CKSPlugIn*>(GetGUI()->GetPlugIn())->SetPreviewCallback(dynamic_cast<CPreviewCallback*>(this));

    ge::IText* pText = CreateDisplay(giControlType, ge::SPos(96, 333+22), ge::SSize(100, 12), CreateFont(Generic128, IDB_Minix_Tight, ge::SRGB(10, 10, 10)), false);
    pText->SetHorzAlignment(ge::IText::HorzAlignLeft);
    pText = CreateDisplay(giControlBitDepth, ge::SPos(96, 347+22), ge::SSize(100, 12), CreateFont(Generic128, IDB_Minix_Tight, ge::SRGB(10, 10, 10)), false);
    pText->SetHorzAlignment(ge::IText::HorzAlignLeft);
    pText = CreateDisplay(giControlSampleRate, ge::SPos(96, 361+22), ge::SSize(100, 12), CreateFont(Generic128, IDB_Minix_Tight, ge::SRGB(10, 10, 10)), false);
    pText->SetHorzAlignment(ge::IText::HorzAlignLeft);
    pText = CreateDisplay(giControlChannels, ge::SPos(96, 375+22), ge::SSize(100, 12), CreateFont(Generic128, IDB_Minix_Tight, ge::SRGB(10, 10, 10)), false);
    pText->SetHorzAlignment(ge::IText::HorzAlignLeft);
} // Init
void CKSSetupGUIPane::Init()
{
	mpPane = ge::IPane::Create();
	mpPane->SetSize(ge::SSize(320,245));
	
	tint32 iPosY = 0;
	CreateBitmap(ge::IControl::giNoID, IDB_Back_Setup, ge::SPos(0, 0)); iPosY += 60;
	
	mpDevice_BMP				= CreateBitmap(ge::IControl::giNoID, IDB_Back_Setup_Device, ge::SPos(0, 54));
	mpDevice_Asio_BMP			= CreateBitmap(ge::IControl::giNoID, IDB_Back_Setup_Device_Asio, ge::SPos(0, 54)); 


	
	// Take lock - no questions
	miBlockSetAudioDevice_volatile = 1;

//	Prepare_Popups();

	
	// Audio In devices
	ge::IPopupMenu::SMenuItemList list;
	list.iItemCount = 0;
	mpPopupMenuAudioIn = CreatePop( giCtrl_Sound_Card_In_Popup, IDB_Button_Popup, list, ge::SPos(47, 69), mpPane);
	// Audio devices/ out
	//ge::IPopupMenu::SMenuItemList list;
	//list.iItemCount = 0;
	mpPopupMenuAudioDevices = CreatePop( giCtrl_Sound_Card_Popup, IDB_Button_Popup, list, ge::SPos(47, 107), mpPane);

	// Audio frequency - giCtrl_Sample_Rate_Popup
	list.iItemCount = 0;
	mpPopupMenuAudioRates = CreatePop( giCtrl_Sample_Rate_Popup, IDB_Button_Popup, list, ge::SPos(47, 107+38), mpPane);

	// Audio buffer - giCtrl_Buffer_Size_Popup
	list.iItemCount = 0;
	mpPopupMenuAudioBuffs = CreatePop( giCtrl_Buffer_Size_Popup, IDB_Button_Popup, list, ge::SPos(47, 107+(38*2)), mpPane);
	

	// ASIO Setup
	mpASIO_Button = CreateButton(giCtrl_Asio_Setup, IDB_Button_Close, ge::SPos(59, 57), false);
	
	
	// Close
	CreateButton(giCtrl_Close_Audio_Setup, IDB_Button_Close, ge::SPos(232, 220), false);

	InitAudioDevicePopupValues();
	InitAudioDevicePopupValuesInput();

	//!!! Remove this
	SetupIO();

	// Release lock
	miBlockSetAudioDevice_volatile--;
}
Beispiel #10
0
//A local helper routine to draw buttons for prev and next year/month.
static VOID DrawButton(HANDLE hWnd,DWORD dwPrevId,DWORD dwNextId)
{
    __RECT rect;
    int x,y;

    GetWindowRect(hWnd,&rect,GWR_INDICATOR_CLIENT);
    x = 3;
    y = 3;
    CreateButton(hWnd,"<-",dwPrevId,x,y,28,20);
    x = rect.right - rect.left - (5 + 28);
    CreateButton(hWnd,"->",dwNextId,x,y,28,20);
}
Beispiel #11
0
BOOL XYWindow::InitWindow()
{
	WNDCLASS wndclass;
	wndclass.style = CS_HREDRAW | CS_VREDRAW;
	wndclass.lpfnWndProc = WndProc;
	wndclass.cbClsExtra = 0;
	wndclass.cbWndExtra = 0;
	wndclass.hInstance = hInstance;
	wndclass.hIcon = LoadIcon(NULL, IDI_APPLICATION);
	wndclass.hCursor = LoadCursor(NULL, IDC_ARROW);
	wndclass.hbrBackground = (HBRUSH)GetStockObject(1);
	wndclass.lpszMenuName = NULL;
	wndclass.lpszClassName = wndClassName;
	if (!RegisterClass(&wndclass))
	{
		return 0;
	}
	hwnd = CreateWindow(wndClassName,
		wndTitle,
		WS_OVERLAPPEDWINDOW,
		CW_USEDEFAULT, CW_USEDEFAULT,
		500, 300,
		NULL,
		NULL,
		hInstance,
		this
		);
	hwndbutton[0] = CreateButton(hwnd, hInstance, 0, RECT{ 1, 1, 30, 30 }, BUTTON_ID_0, "A");
	hwndbutton[1] = CreateButton(hwnd, hInstance, 0, RECT{ 36, 1, 65, 30 }, BUTTON_ID_1, "B");
	hwndbutton[2] = CreateButton(hwnd, hInstance, 0, RECT{ 71, 1, 100, 30 }, BUTTON_ID_2, "C");
	hwndbutton[3] = CreateButton(hwnd, hInstance, 0, RECT{ 106, 1, 135, 30 }, BUTTON_ID_3, "D");
	hwndbutton[4] = CreateButton(hwnd, hInstance, 0, RECT{ 141, 1, 170, 30 }, BUTTON_ID_4, "E");
	hwndbutton[5] = CreateButton(hwnd, hInstance, 0, RECT{ 176, 1, 205, 30 }, BUTTON_ID_5, "F");
	hwndbutton[6] = CreateButton(hwnd, hInstance, 0, RECT{ 211, 1, 240, 30 }, BUTTON_ID_6, "G");
	hwndbutton[7] = CreateButton(hwnd, hInstance, 0, RECT{ 246, 1, 275, 30 }, BUTTON_ID_7, "H");
	hwndbutton[8] = CreateButton(hwnd, hInstance, 0, RECT{ 281, 1, 310, 30 }, BUTTON_ID_8, "I");
	hwndbutton[9] = CreateButton(hwnd, hInstance, 0, RECT{ 316, 1, 345, 30 }, BUTTON_ID_9, "J");
	xybtntst = new XYButton(this->hwnd, hInstance, 351, 1, 30, 30, "blablabla", 492);
	xybtntst->InitWnd();
	xybtntst->SetMessageButton("tstXYButton");
	std::cout << "ButtonID: " << xybtntst->btnID << "ButtonMessage: " << xybtntst->msgButton << std::endl;
	SetButtonPicture(hwndbutton[0], btnpiccapture);
	xydbtst = new XYDrawbox(this->hwnd, hInstance, 0, 35, 40, 20);
	xydbtst->InitWnd();
	//xyDrawbox.InitDrawBox(this->hwnd, this->hInstance, this);
	this->tstusermsg = RegisterWindowMessage("mytestmessagestring");
	if (this->tstusermsg == 0)
	{
		std::cout << "warning!!RegisterWindowMessage(\"mytestmessagestring\"); failed " << std::endl;
	}
	return 1;
}
void MyFrame::InitAboutBox()
{
    wxPanel* pArea = new wxPanel();

    pArea->Create( &mAboutBox, wxID_ANY );

    new wxStaticText(pArea, wxID_ANY, _("This is wxFrameLayout contribution demo."),
        wxPoint(10, 10) );

    new wxStaticText(pArea, wxID_ANY, _("Aleksandras Gluchovas (c) 1998"),
        wxPoint(10, 30) );

    new wxStaticText(pArea, wxID_ANY, _("<mailto:[email protected]>"),
        wxPoint(10, 50) );

    mpAboutBoxLayout = new wxFrameLayout( &mAboutBox, pArea, true );

    wxFrameLayout& layout = *mpAboutBoxLayout;

    cbDimInfo sizes( 90,40,     // when docked horizontally
                     45,55,     // when docked vertically
                     90,40,     // when floated
                     true, 4, 4 // true - bar is fixed-size
                   );


    wxButton* pYes = CreateButton(_("&Yes"),   &mAboutBox, ID_SAY_ITSOK );
    wxButton* pNo  = CreateButton(_("&No"),    &mAboutBox, ID_BTN_NO );
    wxButton* pEsc = CreateButton(_("Cancel"), &mAboutBox, ID_BTN_ESC );

    layout.AddBar( pEsc, sizes,  FL_ALIGN_BOTTOM, 0, 20, _("cancel button"));
    layout.AddBar( pNo,  sizes,  FL_ALIGN_BOTTOM, 0, 20, _("no button"));
    layout.AddBar( pYes, sizes,  FL_ALIGN_BOTTOM, 0, 20, _("yes button"));

    layout.mBorderPen.SetColour( 192, 192, 192 );
    layout.SetMargins( 15, 15, 15, 15, wxALL_PANES );

    cbCommonPaneProperties props;

    layout.GetPaneProperties( props, FL_ALIGN_TOP );

    props.mShow3DPaneBorderOn = false;

    layout.SetPaneProperties( props, wxALL_PANES );

    layout.Activate();

    pYes->SetDefault();
    pYes->SetFocus();
}
Beispiel #13
0
// wparam = (TTBButton*)lpTTBButton
// lparam = hLangpack
INT_PTR TTBAddButton(WPARAM wParam, LPARAM lParam)
{
	if (wParam == 0)
		return -1;

	TTBButton *but = (TTBButton *)wParam;
	if (!(but->dwFlags & TTBBF_ISLBUTTON) && nameexists(but->name))
		return -1;

	TopButtonInt *b = CreateButton(but);
	b->hLangpack = (int)lParam;
	b->LoadSettings();
	b->CreateWnd();
	if (b->hwnd == NULL) {
		delete b;
		return -1;
	}
	mir_cslock lck(csButtonsHook);
	Buttons.insert(b);

	g_ctrl->bOrderChanged = TRUE;
	ArrangeButtons();
	AddToOptions(b);
	return b->id;
}
void ToolsOptionsWindow::OnCreate (HWND hWnd)
{				
	// Make this window handle global
	m_hwnd = hWnd;
	g_hWnd = hWnd; // Need to do this otherwise the control creation wrapper functions don't work.

	HFONT hfDefault = (HFONT) GetStockObject (DEFAULT_GUI_FONT);

	// The status list box
	m_lstcategory = CreateWindow ("listbox", NULL, WS_CHILD | WS_BORDER | WS_VISIBLE | WS_HSCROLL | WS_VSCROLL, 10, 10, 100, 480, hWnd, (HMENU) ID_LSTOPTIONCATEGORY, GetModuleHandle (NULL), NULL);
	SendMessage (m_lstcategory, WM_SETFONT, (WPARAM) hfDefault, MAKELPARAM (FALSE, 0));

	SendMessage (m_lstcategory, LB_SETITEMHEIGHT, 0, 32);

	CreateGeneralPanel ();

	//ID_OPTWINDOWCLOSE
	m_btnclose = CreateButton ("Close", 455, 440, 70, 23, ID_OPTWINDOWCLOSE);

	// Add the categories to the list box
	char szGeneral[SIZE_NAME];
	ZeroMemory (szGeneral, SIZE_NAME);
	strcpy_s (szGeneral, SIZE_NAME, "General");

	SendMessage (m_lstcategory, LB_ADDSTRING, 0, (LPARAM) szGeneral);


	// Read the registry settings, and set the control values
	ReadRegistrySettings ();
}
Beispiel #15
0
void MainTask_DeskTop(void)
{
	int i;
	WM_HWIN Win1,Button1,Button2;
	GUI_Init();
	FS_Init();
	AddRelateFile("TXT","文本",_DemoMultiedit);
	AddRelateFile("MP3","音乐",_DemoMp3);
//	ucfs_sim_init();
//	Win1 = WM_CreateWindow(0,0,480,270,WM_CF_SHOW,NULL,0);
	Win1 = WM_CreateWindow(0,0,480,272,WM_CF_SHOW,_cbWindow1,0);	//houhh 20061024...
	
	WM_SelectWindow(Win1);
#if 1
    GUI_SetColor(GUI_WHITE); 
	GUI_SetBkColor(GUI_BLUE);
	GUI_SetFont(&GUI_FontHZ12);		
	GUI_Clear(); 
#endif	
	CreateButton(Win1,pButton,480,272);
	while (1) {
		if (!GUI_Exec())
			GUI_X_ExecIdle();
	}
//	ucfs_sim_deinit();
}
Beispiel #16
0
int main (int argc, char *argv[])
{
    GtkWidget *window,*table;
    gtk_init (&argc, &argv);

    window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
    gtk_window_set_title (GTK_WINDOW (window), "Calculator");
    gtk_window_set_default_size (GTK_WINDOW (window), 200, 200);

    g_signal_connect(window, "key_press_event",G_CALLBACK(key_press), NULL);

    table = gtk_table_new (5, 4, TRUE);
    CreateButton (table);

    label = gtk_label_new ("0");//The calculator LED !
    gtk_misc_set_alignment (GTK_MISC (label),1,3);
    gtk_table_attach_defaults(GTK_TABLE (table), label,0, 4, 0, 1);
    gtk_widget_show (label);

    gtk_container_add (GTK_CONTAINER (window), table);
    gtk_widget_show (table);
    gtk_widget_show (window);

    gtk_main ();
    return (0);
}
void PositionJavaPinButtonExample::Draw()
{
	//lazily create the pin button when we start drawing so it is not displayed on top of the loading screen
	if(m_world.Initialising())
	{
		return;
	}
	else if(m_buttonID == 0)
	{
		CreateButton();
	}

	//get an env for the current thread
	//
	//AndroidSafeNativeThreadAttachment will detach the thread if required at the end of the method
	AndroidSafeNativeThreadAttachment attached(m_nativeState);
	JNIEnv* env = attached.envForThread;

	//calculate a screen position for the pin based on an ECEF location
	const Eegeo::Space::LatLongAltitude pinLocation = Eegeo::Space::LatLongAltitude::FromDegrees(37.7858,-122.401, 0.f);
	Eegeo::v3 screenPosition;
	Project(pinLocation, screenPosition);

	//update the screen position of the pin using the cached update method on the cached object reference to
	//the pin controller, using the parameters we have calculated and the handle to the pin created earlier
	env->CallVoidMethod(
	    m_hudPinController,
	    m_updateLocationMethodId,
	    m_buttonID,
	    screenPosition.GetX(),
	    screenPosition.GetY()
	);
}
void LocalTerminalWidget::InitializeExitButton() {
  exit_button_ = CreateButton(
    ":/image/exit.png", QString::fromLocal8Bit("关闭"));
  exit_menu_ = new QMenu(this);

  QAction *logout_action = new QAction(QString::fromLocal8Bit("注销"), this);
  connect(logout_action, &QAction::triggered,
    this, &LocalTerminalWidget::RequestLogoutSignal);
  exit_menu_->addAction(logout_action);

  QAction *restart_action = new QAction(QString::fromLocal8Bit("重启"), this);
  connect(restart_action, &QAction::triggered,
    this, &LocalTerminalWidget::RequestRestartSignal);
  exit_menu_->addAction(restart_action);

#ifdef _DEBUG
  QAction *quit_system_action = new QAction(QString::fromLocal8Bit("退出"), this);
  connect(quit_system_action, &QAction::triggered,
    this, &LocalTerminalWidget::RequestQuitSystemSignal);
 exit_menu_->addAction(quit_system_action);
#else 
  QAction *shutdown_action = new QAction(QString::fromLocal8Bit("关机"), this);
  connect(shutdown_action, &QAction::triggered,
    this, &LocalTerminalWidget::RequestShutdownSignal);
  exit_menu_->addAction(shutdown_action);
#endif // DEBUG

  exit_button_->setMenu(exit_menu_);
}
Beispiel #19
0
static uintptr_t CPROC LoadMacroElements( uintptr_t psv, arg_list args )
{
	PMACRO_BUTTON pmb = (PMACRO_BUTTON)psv;
	PARAM( args, TEXTCHAR *, name );
	PMACRO_ELEMENT element = New( MACRO_ELEMENT );
	PPAGE_DATA page = InterShell_GetCurrentLoadingPage();
	PCanvasData canvas = InterShell_GetCurrentLoadingCanvas();
	if( !pmb )
		if( l.finished_startup )
		{
			if( !l.shutdown.button )
				l.shutdown.button = CreateButton( canvas, page );
			pmb = &l.shutdown;
		}
		else
		{
			if( !l.startup.button )
				l.startup.button = CreateButton( canvas, page );
			pmb = &l.startup;
		}
	element->me = NULL;
	element->next = NULL;
	element->button = CreateInvisibleControl( canvas
	                                        , name );
	if( element->button )
	{
		//lprintf( WIDE( "Setting container of %p to %p" ), element->button, pmb->button );
		element->button->container_button = pmb->button;
		LinkLast( pmb->elements, PMACRO_ELEMENT, element );
		if( !BeginSubConfigurationEx( element->button, name, (pmb==&l.startup)
											?WIDE( "Startup macro element done" )
											:(pmb==&l.shutdown)
											?WIDE( "Shutdown macro element done" )
											:WIDE( "macro element done" ) ) )
		{
			PublicAddCommonButtonConfig( element->button );
		}
		//SetCurrentLoadingButton( element->button );
		//lprintf( WIDE( "Resulting with psv %08x" ), element->button->psvUser );
		return element->button->psvUser;
	}
	else
		lprintf( "Failed to create a %s", name );
	return 0;
}
Beispiel #20
0
//------------------------------------------
// 初期化関数
bool TsceneStageSelect::Initialize( void )
{

	FhWnd = TaskManager().GethWnd();
	FiClientX = TaskManager().GetiClientX();
	FiClientY = TaskManager().GetiClientY();

	// 画像をメモリに読み込む
	FpBackGround = DxGraphics9().CreateSpriteFormFile(TEXT("stage_select_back.png"),D3DFMT_A8R8G8B8 , D3DCOLOR_ARGB( 255, 255, 0, 0));
	FpBtnStg1 = DxGraphics9().CreateSpriteFormFile(TEXT("btn_stg1.png"),D3DFMT_A8R8G8B8 , D3DCOLOR_ARGB( 255, 255, 0, 0));
	FpBtnStg2 = DxGraphics9().CreateSpriteFormFile(TEXT("btn_stg2.png"),D3DFMT_A8R8G8B8 , D3DCOLOR_ARGB( 255, 255, 0, 0));
	FpBtnStg3 = DxGraphics9().CreateSpriteFormFile(TEXT("btn_stg3.png"),D3DFMT_A8R8G8B8 , D3DCOLOR_ARGB( 255, 255, 0, 0));
	FpBtnStg4 = DxGraphics9().CreateSpriteFormFile(TEXT("btn_stg4.png"),D3DFMT_A8R8G8B8 , D3DCOLOR_ARGB( 255, 255, 0, 0));
	FpBtnStg5 = DxGraphics9().CreateSpriteFormFile(TEXT("btn_stg5.png"),D3DFMT_A8R8G8B8 , D3DCOLOR_ARGB( 255, 255, 0, 0));
	FpBtnReward = DxGraphics9().CreateSpriteFormFile(TEXT("btn_rewards.png"),D3DFMT_A8R8G8B8 , D3DCOLOR_ARGB( 255, 255, 0, 0));
	FpBtnCursor = DxGraphics9().CreateSpriteFormFile(TEXT("btn_cursor.png"),D3DFMT_A8R8G8B8 , D3DCOLOR_ARGB( 255, 255, 0, 0));
	FpBtnKanata = DxGraphics9().CreateSpriteFormFile(TEXT("kanata_btn_selected.png"),D3DFMT_A8R8G8B8 , D3DCOLOR_ARGB( 255, 255, 0, 0));
	FpBtnKanataS = DxGraphics9().CreateSpriteFormFile(TEXT("kanata_btn_selected.png"),D3DFMT_A8R8G8B8 , D3DCOLOR_ARGB( 255, 255, 0, 0));
	FpBtnShion = DxGraphics9().CreateSpriteFormFile(TEXT("shion_btn_normal.png"),D3DFMT_A8R8G8B8 , D3DCOLOR_ARGB( 255, 255, 0, 0));
	FpBtnShionS = DxGraphics9().CreateSpriteFormFile(TEXT("shion_btn_selected.png"),D3DFMT_A8R8G8B8 , D3DCOLOR_ARGB( 255, 255, 0, 0));

	// ボタン作成
	CreateButton(UI_BTN_STG_1,Vector2D(-20,-20),Vector2D(0,0));
	CreateButton(UI_BTN_STG_2,Vector2D(-20,-10),Vector2D(0,0));
	CreateButton(UI_BTN_STG_3,Vector2D(-20,0),Vector2D(0,0));
	CreateButton(UI_BTN_STG_4,Vector2D(-20,10),Vector2D(0,0));
	CreateButton(UI_BTN_STG_5,Vector2D(-20,20),Vector2D(0,0));
	CreateButton(UI_BTN_SHION,Vector2D(20,-20),Vector2D(0,0));
	CreateButton(UI_BTN_KANATA,Vector2D(20,20),Vector2D(0,0));
	return true;
}
void
EditButtonWindow::SetMenu(void)
{
	BButton	*e;

	e = CreateButton(MyRect(10,10,120,25),GetMessage(msg_list),tab_menu_editlist);

	vie2->AddChild(e);
}
Beispiel #22
0
Button::Button(char *category, MotifUI *parent, char *name,
	       ButtonType button_type, ButtonCallback callback,
	       void * callback_data, char *mnemonic, char *acceleratorText,
	       char *accelerator, char *iconFile)
	: MotifUI(parent, name, category)
{
   CreateButton(parent, name, category, button_type, callback, callback_data,
	        mnemonic, acceleratorText, accelerator, iconFile);
}
Beispiel #23
0
/*
*--------------------------------------------------------------------------------
*  函数名	: OnCreate
*  功能     : 重载创建窗口消息
*  说明     : 创建窗口时创建形变按钮
*--------------------------------------------------------------------------------
*/
int CFloatDibWnd::OnCreate(LPCREATESTRUCT lpCreateStruct) 
{
	if (CWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	CreateButton();

	return 0;
}
Beispiel #24
0
DebugMenuCommand::DebugMenuCommand(const char * a_name, Widget * a_parent, Colour a_colour, EditType::Enum a_parentMenu)
: m_gameObjectFunction()
, m_widgetFunction()
, m_alignment(DebugMenuCommandAlign::Below)
, m_widget(NULL)
, m_parentMenu(a_parentMenu)
{
	m_widget = CreateButton(a_name, a_parent, a_colour);
}
ge::IButton* CBaseTopPane::InsertLoadButton(tuint32 uiResourceID, const ge::SPos& Pos, tbool bMouseStateFrames)
{
	ge::IButton* pButton =CreateButton(giBaseControlIDTopPaneLoad,
		uiResourceID,
		Pos,
		bMouseStateFrames);
//	pButton->AddListener(dynamic_cast<ge::IEventReceiver*>(this));

	return pButton;
}
Beispiel #26
0
    TRef<IObject> Apply(ObjectStack& stack)
    {
        TVector<int> m_vecColumns;
        ParseIntVector((IObject*)stack.Pop(), m_vecColumns);
		
		TVector<ZString> m_vecColumnsNames;
        ParseStringVector((IObject*)stack.Pop(), m_vecColumnsNames);

        TRef<Number>      pnumberFaces;  CastTo(pnumberFaces,  (IObject*)stack.Pop());
        bool              bActAsTabs = false;

        if (stack.GetCount() > 0)
        {
            TRef<Boolean>  pbooleanActAsTabs;  CastTo(pbooleanActAsTabs, (IObject*)stack.Pop());
            bActAsTabs = pbooleanActAsTabs->GetValue();
        }

        TRef<ButtonBarPane> pbuttonbar = 
            CreateButtonBarPane(bActAsTabs,false);

		int count = m_vecColumns.GetCount();
		int xprev = 0;

		for (int index = 0; index < count; index++) {
			int x = m_vecColumns[index];

			WinPoint p = TrekResources::SmallFont()->GetTextExtent(m_vecColumnsNames[index]);

			TRef<StringPane> s1 = new StringPane(
									m_vecColumnsNames[index],
									TrekResources::SmallFont(),
									WinPoint(x-xprev,p.Y()),
									JustifyLeft());
			TRef<StringPane> s2 = new StringPane(
									m_vecColumnsNames[index],
									TrekResources::SmallBoldFont(),
									WinPoint(x-xprev,p.Y()),
									JustifyLeft());
			s1->SetOpaque(true);
			s1->SetTextColor(Color::White());
			s2->SetOpaque(true);
			s2->SetTextColor(Color::Yellow());

			pbuttonbar->InsertButton(CreateButton(CreateButtonFacePane(s1,s2)),index);

			xprev = x;
		}
    
        pbuttonbar->GetMouseEnterWhileEnabledEventSource()->AddSink(new SoundIDEventSink(mouseoverSound));
        pbuttonbar->GetEventSource()->AddSink(new SoundIDEventSink(mouseclickSound));

        return pbuttonbar;
    }
Beispiel #27
0
void TASInputDlg::CreateBaseLayout()
{
	for (unsigned int i = 0; i < 10; ++i)
		m_controls[i] = nullptr;
	for (unsigned int i = 0; i < 14; ++i)
		m_buttons[i] = nullptr;

	m_buttons[0] = &m_dpad_down;
	m_buttons[1] = &m_dpad_up;
	m_buttons[2] = &m_dpad_left;
	m_buttons[3] = &m_dpad_right;
	m_buttons[4] = &m_a;
	m_buttons[5] = &m_b;
	m_controls[0] = &m_main_stick.x_cont;
	m_controls[1] = &m_main_stick.y_cont;

	m_a = CreateButton("A");
	m_b = CreateButton("B");
	m_dpad_up = CreateButton("Up");
	m_dpad_right = CreateButton("Right");
	m_dpad_down = CreateButton("Down");
	m_dpad_left = CreateButton("Left");

	m_buttons_dpad->AddSpacer(20);
	m_buttons_dpad->Add(m_dpad_up.checkbox, false);
	m_buttons_dpad->AddSpacer(20);
	m_buttons_dpad->Add(m_dpad_left.checkbox, false);
	m_buttons_dpad->AddSpacer(20);
	m_buttons_dpad->Add(m_dpad_right.checkbox, false);
	m_buttons_dpad->AddSpacer(20);
	m_buttons_dpad->Add(m_dpad_down.checkbox, false);
	m_buttons_dpad->AddSpacer(20);

	Bind(wxEVT_CLOSE_WINDOW, &TASInputDlg::OnCloseWindow, this);
}
Beispiel #28
0
WOGButtonGroup* OGSceneConfig::CreateButtonGroup(const QDomElement &element)
{
    WOGButtonGroup* obj = new WOGButtonGroup;
    obj->id = element.attribute("id");
    obj->osx = StringToPoint(element.attribute("osx"));

    for (QDomNode n = element.firstChild(); !n.isNull(); n = n.nextSibling())
    {
        obj->button << CreateButton(n.toElement());
    }

    return obj;
}
Beispiel #29
0
Widget::Widget(QWidget *parent)
    : QWidget(parent)
{
    setWindowTitle(tr("音乐播放器"));
    setMaximumWidth(320);
    setMinimumWidth(320);
    setMinimumHeight(500);

    CreateButton();
    CreatePlayList();
    CreateMusicPlayer();

    //MusicFilePath="c:";
}
Beispiel #30
0
//Create only one button message box,MB_OK.
static VOID CreateOk(HANDLE hWnd,__MESSAGE_BOX* pMsgBox)
{
	int x,y;  //Start position of button.
	x = pMsgBox->dwMsgBoxWidth - MSGBOX_BUTTON_WIDTH;  //Only one button.
	x /= 2;
	y = pMsgBox->dwMsgBoxHeight - 10 - GlobalParams.dwWndCaptionHeight;
	y -= MSGBOX_BUTTON_HEIGHT;
	if(y < 0)
	{
		y = 0;
	}
	CreateButton(hWnd,"确定(O)",ID_OK,x,y,MSGBOX_BUTTON_WIDTH,MSGBOX_BUTTON_HEIGHT);
	return;
}