void LevelSelectMainTerm()
{
    DeleteButtons();
    TerminateMessages();

    LevelTerm();
}
void ExamplesMainTerm()
{
    DeleteButtons();
    TerminateMessages();

    ExampleTerm();
}
//--------------------------------------------------------------------------
void ExampleShutDown()
{
	s3ePointerUnRegister(S3E_POINTER_BUTTON_EVENT, (s3eCallback)SingleTouchButtonCB);
	s3ePointerUnRegister(S3E_POINTER_MOTION_EVENT, (s3eCallback)SingleTouchMotionCB);
	
	DeleteButtons();
}
Beispiel #4
0
//-----------------------------------------------------------------------------
// Main global function
//-----------------------------------------------------------------------------
int main()
{
#ifdef EXAMPLE_DEBUG_ONLY
    // Test for Debug only examples
#ifndef IW_DEBUG
    DisplayMessage("This example is designed to run from a Debug build. Please build the example in Debug mode and run it again.");
    return 0;
#endif
#endif

    //IwGx can be initialised in a number of different configurations to help the linker eliminate unused code.
    //Normally, using IwGxInit() is sufficient.
    //To only include some configurations, see the documentation for IwGxInit_Base(), IwGxInit_GLRender() etc.
    IwGxInit();

    // Example main loop
    ExampleInit();

    // Set screen clear colour
    IwGxSetColClear(0xff, 0xff, 0xff, 0xff);
    IwGxPrintSetColour(128, 128, 128);
    
    while (1)
    {
        s3eDeviceYield(0);
        s3eKeyboardUpdate();
        s3ePointerUpdate();

        int64 start = s3eTimerGetMs();

        bool result = ExampleUpdate();
        if  (
            (result == false) ||
            (s3eKeyboardGetState(s3eKeyEsc) & S3E_KEY_STATE_DOWN) ||
            (s3eKeyboardGetState(s3eKeyAbsBSK) & S3E_KEY_STATE_DOWN) ||
            (s3eDeviceCheckQuitRequest())
            )
            break;

        // Clear the screen
        IwGxClear(IW_GX_COLOUR_BUFFER_F | IW_GX_DEPTH_BUFFER_F);
        RenderButtons();
        RenderSoftkeys();
        ExampleRender();

        // Attempt frame rate
        while ((s3eTimerGetMs() - start) < MS_PER_FRAME)
        {
            int32 yield = (int32) (MS_PER_FRAME - (s3eTimerGetMs() - start));
            if (yield<0)
                break;
            s3eDeviceYield(yield);
        }
    }
    ExampleShutDown();
    DeleteButtons();
    IwGxTerminate();
    return 0;
}
Beispiel #5
0
bool TaskToolbar::Create(CWnd* parent, UINT id, bool vertical)
{
	static const int commands[]=
	{
		ID_VIEW,
		ID_TASK_TRANSFER, ID_TASK_COPY, ID_TASK_MOVE, ID_TASK_RENAME, ID_TASK_COPY_TAGGED,
		ID_TASK_RESIZE, ID_TASK_ROTATE, ID_TASK_EDIT_IPTC,
		ID_TASK_GEN_SLIDE_SHOW, ID_TASK_GEN_HTML_ALBUM, ID_BUILD_CATALOG,
		ID_TASK_PRINT, ID_TASK_EXPORT, ID_TASK_HISTOGRAM,
		ID_TASK_TOUCH_UP, ID_SEND_EMAIL, ID_DATE_TIME_ADJ,
		ID_TASK_EXTRACT_JPEG, ID_TASK_DELETE
	};

	if (vertical)
		SetPadding(0, 0);
	else
		SetPadding(0, 4);

	small_icons_ = AfxGetApp()->GetProfileInt(REGISTRY_SECTION_TOOLBAR, REG_ICONS, 0) == 0;

	int bmp_id= small_icons_ ? TOOLBAR_BITMAP_SMALL : TOOLBAR_BITMAP_BIG;

	DWORD tb_style= WS_CHILD | WS_VISIBLE | TBSTYLE_TOOLTIPS | TBSTYLE_FLAT | TBSTYLE_TRANSPARENT |
		/*CCS_TOP |*/ CCS_NORESIZE | CCS_NOPARENTALIGN | CCS_NODIVIDER | TBSTYLE_ALTDRAG | CCS_ADJUSTABLE;

	if (vertical)
		tb_style |= CCS_RIGHT;
	else
		tb_style |= CCS_TOP;

	if (!CToolBarCtrl::Create(tb_style, CRect(0,0,0,0), parent, id))
		return false;

	int w= 0;
	{
		CClientDC dc(parent);
		dc.SelectStockObject(DEFAULT_GUI_FONT);
		w = dc.GetTextExtent(_T("NNNNNNa"), 7).cx;
	}
	// limit button width to make labels wrap
	if (vertical)
		w = w * 13 / 10;
	SendMessage(TB_SETBUTTONWIDTH, 0, MAKELONG(w, w));
	SendMessage(TB_SETDRAWTEXTFLAGS, DT_WORDBREAK, DT_WORDBREAK);
	SendMessage(TB_SETDRAWTEXTFLAGS, DT_SINGLELINE, 0);
	SendMessage(TB_SETMAXTEXTROWS, vertical ? 1 : 2, 0);

	AddButtons("P|PPPPP|PPPPPPPPPPPPPP", commands, bmp_id, IDS_BROWSER_TOOLS, vertical);

	CreateDisabledImageList(bmp_id, saturation, lightness, alpha);

	DeleteButtons();

	return true;
}
void ExamplesMainTerm()
{
    TerminateMessages();

    // User code term
    ExampleTerm();

    delete g_CursorMaterial;
    DeleteButtons();

    //TODO: Switch to IwGx font so we can both measure the font size and scale it

    //IwGxFontTerminate();
    //IwResManagerTerminate();
    IwGxTerminate();
}
Beispiel #7
0
void TaskToolbar::ResetToolBar(bool resize_to_fit)
{
	ToolBarWnd::ResetToolBar(resize_to_fit);
	DeleteButtons();
}