Example #1
0
void CreateFileDialog( UINT16 *zTitle )
{

    iFDlgState = DIALOG_NONE;

    DisableEditorTaskbar();

    MSYS_DefineRegion( &BlanketRegion, 0, 0, gsVIEWPORT_END_X, gsVIEWPORT_END_Y, MSYS_PRIORITY_HIGH - 5, 0, 0, 0 );

    //Okay and cancel buttons
    iFileDlgButtons[0] = CreateTextButton( L"Okay", FONT12POINT1, FONT_BLACK, FONT_BLACK,
                                           BUTTON_USE_DEFAULT, 354, 225, 50, 30, BUTTON_NO_TOGGLE,	MSYS_PRIORITY_HIGH, DEFAULT_MOVE_CALLBACK, FDlgOkCallback );
    iFileDlgButtons[1] = CreateTextButton( L"Cancel", FONT12POINT1, FONT_BLACK, FONT_BLACK,
                                           BUTTON_USE_DEFAULT, 406, 225, 50, 30, BUTTON_NO_TOGGLE, MSYS_PRIORITY_HIGH, DEFAULT_MOVE_CALLBACK, FDlgCancelCallback );

    //Scroll buttons
    iFileDlgButtons[2] = CreateSimpleButton( 426,92,"EDITOR//uparrow.sti", BUTTON_NO_TOGGLE,
                         MSYS_PRIORITY_HIGH, FDlgUpCallback );
    iFileDlgButtons[3] = CreateSimpleButton( 426,182,"EDITOR//downarrow.sti", BUTTON_NO_TOGGLE,
                         MSYS_PRIORITY_HIGH, FDlgDwnCallback );

    //File list window
    iFileDlgButtons[4] = CreateHotSpot( (179+4), (69+3), (179+4+240), (69+120+3), MSYS_PRIORITY_HIGH-1, BUTTON_NO_CALLBACK, FDlgNamesCallback);
    //Title button
    iFileDlgButtons[5] = CreateTextButton(zTitle, HUGEFONT, FONT_LTKHAKI, FONT_DKKHAKI,
                                          BUTTON_USE_DEFAULT,179,39,281,30,BUTTON_NO_TOGGLE,
                                          MSYS_PRIORITY_HIGH-2,BUTTON_NO_CALLBACK,BUTTON_NO_CALLBACK);
    DisableButton(iFileDlgButtons[5]);
    SpecifyDisabledButtonStyle( iFileDlgButtons[5], DISABLED_STYLE_NONE );

    iFileDlgButtons[6] = -1;
    if( iCurrentAction == ACTION_SAVE_MAP )
    {   //checkboxes
        //The update world info checkbox
        iFileDlgButtons[6] = CreateCheckBoxButton( 183, 229, "EDITOR//smcheckbox.sti", MSYS_PRIORITY_HIGH, UpdateWorldInfoCallback );
        if( gfUpdateSummaryInfo )
            ButtonList[ iFileDlgButtons[6] ]->uiFlags |= BUTTON_CLICKED_ON;
    }

    //Add the text input fields
    InitTextInputModeWithScheme( DEFAULT_SCHEME );
    //field 1 (filename)
    AddTextInputField( /*233*/183, 195, 190, 20, MSYS_PRIORITY_HIGH, gzFilename, 30, INPUTTYPE_EXCLUSIVE_DOSFILENAME );
    //field 2 -- user field that allows mouse/key interaction with the filename list
    AddUserInputField( FileDialogModeCallback );

}
Example #2
0
bool PartyList::init()
{
	CCSize visibleSize = CCDirector::sharedDirector()->getVisibleSize();

	ignoreAnchorPointForPosition(false);

	m_cellWidth = 200 + 10;
	m_cellHeight = 200 + 10;

	int w = MAX(visibleSize.width/5, m_cellWidth ); //windows wants to use 'max' and mac wants to use 'maxf'
	int h = visibleSize.height;

	setContentSize(CCSizeMake(w, h));
	ignoreAnchorPointForPosition(false);

	m_bg = CCLayerColor::create(ccc4(240,227,132,125), w, h);
	addChild(m_bg);


	for( int i=0; i< MAX_PARTY_MEMBERS; i++) {

		BaseRadioGroupLayer* radio = new BaseRadioGroupLayer();
		radio->initRadioGroup("partyMemberSelect", i);
		//radio->addChild(view);
		radio->setAnchorPoint(ccp(0.5,0.5));
		radio->setPosition( m_cellWidth/2, h - (m_cellHeight/2 + i*m_cellHeight));
		radio->setContentSize(CCSizeMake(m_cellWidth, m_cellHeight));

		addChild(radio);
		m_partyButtons[i] = radio;

		radio->setVisible(false); //all off until filled

	}

	for( int i=0; i< MAX_PARTY_MEMBERS; i++) {

		TouchableNode* btn = CreateSimpleButton("+ Party Member", "addPartyMemberBtn");
		btn->setAnchorPoint(ccp(0.5,0.5));
		btn->setPosition( m_cellWidth/2, h -( m_cellHeight/2 + i*m_cellHeight));

		addChild(btn);
		m_partyAddButtons[i] = btn;

		btn->setVisible(true);
		btn->setTouchEnabled(true);

	}

	loadEntitiesForPartyJson();

	
	return true;
}