Esempio n. 1
0
// Creates New Scene
void V4StudioFrame::OnNew(wxCommandEvent &event)
{
	m_pV4sm = new V4SceneManager(this);
	m_pV4sm->LoadNew();

	m_pMainToolbar->EnableTool(TOOL_ADD_TO_TL, true);
	m_pMainToolbar->EnableTool(TOOL_VIEW_DICT, true);
	m_pMainToolbar->EnableTool(TOOL_FILE_SAVE, true);
	m_pFileMenu->Enable(MENU_FILE_SAVE, true);
	m_pMainToolbar->EnableTool(TOOL_FILE_CLOSE, true);
	m_pFileMenu->Enable(MENU_FILE_CLOSE, true);
	m_pMainToolbar->EnableTool(TOOL_FILE_OPEN, false);
	m_pFileMenu->Enable(MENU_FILE_OPEN, false);
	m_pMainToolbar->EnableTool(TOOL_FILE_NEW, false);
	m_pFileMenu->Enable(MENU_FILE_NEW, false);
	m_pFileMenu->Enable(CHANGE_SIZE_DIALOG, true);
	m_pFileMenu->Enable(CHANGE_LENGTH, true);
	m_pFileMenu->Enable(CHANGE_FRAMERATE, true);

	Layout();
	SetStatusText("New scene", 0);
	SceneGraphChanged();

	OnChangeSize(event);
}
Esempio n. 2
0
void cWidgetListBox::OnInit()
{
    mpSlider = mpSet->CreateWidgetSlider(eWidgetSliderOrientation_Vertical,0,0,0,this);
    mpSlider->AddCallback(eGuiMessage_SliderMove,this,kGuiCallback(MoveSlider));

    AddCallback(eGuiMessage_OnDraw,this,kGuiCallback(DrawText));

    OnChangeSize();
}
Esempio n. 3
0
	void cWidgetComboBox::UpdateProperties()
	{
		if((int)mvItems.size() <= mlMaxItems)
			mlItemsShown = (int)mvItems.size();
		else
			mlItemsShown = mlMaxItems;

		mfMenuHeight = 2 + (mvDefaultFontSize.y+2)* (float)mlItemsShown + 2;
		
		OnChangeSize();
	}
Esempio n. 4
0
	void cWidgetTextBox::OnLoadGraphics()
	{
		mpGfxMarker = mpSkin->GetGfx(eGuiSkinGfx_TextBoxMarker);
		mpGfxSelectedTextBack = mpSkin->GetGfx(eGuiSkinGfx_TextBoxSelectedTextBack);

		mpGfxBackground = mpSkin->GetGfx(eGuiSkinGfx_TextBoxBackground);

		mvGfxBorders[0] = mpSkin->GetGfx(eGuiSkinGfx_FrameBorderRight);
		mvGfxBorders[1] = mpSkin->GetGfx(eGuiSkinGfx_FrameBorderLeft);
		mvGfxBorders[2] = mpSkin->GetGfx(eGuiSkinGfx_FrameBorderUp);
		mvGfxBorders[3] = mpSkin->GetGfx(eGuiSkinGfx_FrameBorderDown);

		mvGfxCorners[0] = mpSkin->GetGfx(eGuiSkinGfx_FrameCornerLU);
		mvGfxCorners[1] = mpSkin->GetGfx(eGuiSkinGfx_FrameCornerRU);
		mvGfxCorners[2] = mpSkin->GetGfx(eGuiSkinGfx_FrameCornerRD);
		mvGfxCorners[3] = mpSkin->GetGfx(eGuiSkinGfx_FrameCornerLD);

		OnChangeSize();
	}
Esempio n. 5
0
	void cWidgetComboBox::OnInit()
	{
		m_pText = m_pSet->CreateWidgetTextBox(0,m_vSize,_W(""),this);
		m_pText->SetText(m_sText);
		m_pText->SetCanEdit(false);

		m_pButton = m_pSet->CreateWidgetButton(0,0,_W(""),this);
		m_pButton->SetImage(m_pSkin->GetGfx(eGuiSkinGfx_ComboBoxButtonIcon), false);
		m_pButton->AddCallback(eGuiMessage_MouseDown, this, kGuiCallback(ButtonPress));

		m_pSlider = m_pSet->CreateWidgetSlider(eWidgetSliderOrientation_Vertical,0,0,0,this);
		m_pSlider->AddCallback(eGuiMessage_SliderMove,this,kGuiCallback(SliderMove));
		m_pSlider->AddCallback(eGuiMessage_LostFocus,this,kGuiCallback(SliderLostFocus));
		m_pSlider->SetEnabled(false);
		m_pSlider->SetVisible(false);

		AddCallback(eGuiMessage_OnDraw,this,kGuiCallback(DrawText));

		OnChangeSize();
	}
Esempio n. 6
0
	void cWidgetTextBox::SetMaxTextSizeNeg(float afX)
	{
		mfMaxTextSizeNeg = afX;

		OnChangeSize();
	}
Esempio n. 7
0
LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    int wmId, wmEvent;
    PAINTSTRUCT ps;
    HDC hdc;

    switch (message)
    {
    case WM_COMMAND:
        wmId    = LOWORD(wParam);
        wmEvent = HIWORD(wParam);

        switch (wmId)
        {
        case IDM_COPY:
            OnCopy(hWnd);
            break;

        case IDM_ABOUT:
            DialogBox(hInst, MAKEINTRESOURCE(IDD_ABOUTBOX), hWnd, About);
            break;

        case IDM_200X150:
            OnChangeSize(hWnd, 200, 150);
            sizetype = ST_200X150;
            break;

        case IDM_320X240:
            OnChangeSize(hWnd, 320, 240);
            sizetype = ST_320X240;
            break;

        case IDM_640X480:
            OnChangeSize(hWnd, 640, 480);
            sizetype = ST_640X480;
            break;

        case IDM_1024X768:
            OnChangeSize(hWnd, 1024, 768);
            sizetype = ST_1024X768;
            break;

        case IDM_EXIT:
            DestroyWindow(hWnd);
            break;
        }
        break;

    case WM_INITMENUPOPUP:
        OnInitMenuPopup(hWnd, (HMENU)wParam);
        break;

    case WM_PAINT:
        hdc = BeginPaint(hWnd, &ps);
        OnPaint(hWnd, hdc);
        EndPaint(hWnd, &ps);
        break;

    case WM_DESTROY:
        PostQuitMessage(0);
        break;

    default:
        return DefWindowProc(hWnd, message, wParam, lParam);
    }
    return 0;
}
Esempio n. 8
0
	void iWidget::SetSize(const cVector2f &avSize)
	{
		mvSize = avSize;
		
		OnChangeSize();
	}