Example #1
0
TabThird_GroupFour::TabThird_GroupFour(QWidget *parent)
    :QGroupBox(parent)
{
    // ÅÅ°æ
    iLayout = new QVBoxLayout;

    // ¹¹Ôì
    SetupGroup();

    this->setLayout(iLayout);
}
Example #2
0
TabSecond_GroupThree::TabSecond_GroupThree(QWidget *parent)
    :QGroupBox(parent)
{
    iDialog = new TabSecond_GroupThree_Dialog(this);

    // 排版
    iLayout = new QVBoxLayout;

    // 构造
    SetupGroup();

    this->setLayout(iLayout);
}
Example #3
0
void
CEditTile::Setup(bool fSetupTile, bool fSetupGroup, bool fSetupSpace)
{
	uint32		loop1;
	grip			g;
	SmartBox		*pBox;
	SmartDialog	*pDialog;
	Window		*pWin;
	char			szString1[80];
	uchar			oldFore = pFontMgr->colors[FNT_FORE_COLOR], oldBack = pFontMgr->colors[FNT_BACK_COLOR];

	BoxCount = 0;
//	PROF_Reset();

	// grab fresh data from lists as necessary (like if GroupNum or SpaceNum are changed)
	if(fSetupTile)
		currTile.Copy(ADerefAs(Tile, pTileLib->gTile[TileNum]), sizeof(currTile));
	if(fSetupGroup)
		currGroup.Copy(ADerefAs(TileGroup, pTileLib->gTileGroup[currTile.h.GroupNum]), sizeof(currGroup));
	if(fSetupSpace && SpaceNum > 0)
		currSpace.Copy(ADerefAs(MapSpaceBase, pMap->gSpaces[SpaceNum]), sizeof(currSpace));


	// if dialog already exists, delete it first (group # must have changed)
	if(gDialog)
	{
		pDialog = ADerefAs(SmartDialog, gDialog);
		pDialog->SetupReplies(NULL, NULL);
		pDialog->Deactivate();
		ADelete(gDialog);
		ClearGrips();
	}

	if(pCEditor->gSaveWindow)
	{
		pWin = ADerefAs(Window, pCEditor->gSaveWindow);
		pWin->Show();
		TRACK_MEM("TileDialog"); pDialog = new SmartDialog(0, 0, pWin->gSelf, CI_WHITE, 2);
	}
	else
	{
		TRACK_MEM("TileDialog"); pDialog = new SmartDialog(0, 0, DG_DFT_WINDOW, CI_WHITE, 2);
	}
	gDialog = pDialog->gSelf;

	SetColors(CI_BLACK, CI_WHITE, CI_WHITE);

	sprintf(szString1, "Tile Editor - %d Types, %d Clusters", pTileLib->h.totalTileGroups, pMap->h.totalSpaces);
	g = pDialog->AddSmartLabel(30, 5, szString1);
	sprintf(szString1, "Tile %d", TileNum);
	g = pDialog->AddSmartLabel(10, 30, szString1);
  
	if(!pCEditor->gSaveWindow)
		SetupLabels();
	SetupGroup(fSetupGroup);
	SetupSpace();
	
	SetColors(CI_WHITE, CI_BLACK, CI_BLACK);

	if(fSetupTile)
	{
		sprintf(szSwapTileText, "%d", currTile.h.swapTile);
		sprintf(szGroupAnim, "%d", currTile.h.animTile);
		sprintf(szGroupAnimDelay, "%d", currTile.h.animDelay);
	}
	gBoxes[BoxCount++] = pDialog->AddSmartBox(85, 30, szSwapTileText, 4);
	gBoxes[BoxCount++] = pDialog->AddSmartBox(145, 30, szGroupAnim, 4);
	gBoxes[BoxCount++] = pDialog->AddSmartBox(210, 30, szGroupAnimDelay, 3);

	gNewGroup = pDialog->AddSmartButton(10, 200, "NEW TYPE", FALSE, gSelf, SELECTED);

	gNewSpace = pDialog->AddSmartButton(100, 200, "NEW CLUST", FALSE, gSelf, SELECTED);

	pDialog->AddSmartButton(190, 200, "OK", TRUE, gSelf, SELECTED);

	pDialog->SetupReplies(gSelf, DESELECTED);	// notify this context when dialog is Deactivate()'ed
	pDialog->SetPos(5, 5);
	pDialog->Activate(M_MODAL, 500);	// cause default window to be defined, so Controls can base their pri on it
	pWin = ADerefAs(Window, pDialog->gWin);
	if(!pCEditor->gSaveWindowCel)	// if window hasnt been saved yet
	{
		Window		*pNewWin;
		pWin = ADerefAs(Window, pDialog->gWin);
		CelHeader	*pCel;

		// copy Dialog::window cel for re-use later, to avoid re-creation overhead
		TRACK_MEM("temp Cel");	pCEditor->gSaveWindowCel = ACreateCel(&pCEditor->rNumSaveWindowCel,
				0, 0, pWin->scrim.rect.Wide(), pWin->scrim.rect.High(), 1, CI_WHITE);
		pCel = (CelHeader *)pResMgr->GetResData(pCEditor->gSaveWindowCel);
		CopyCel(pCel, 0, 0, pWin->scrim.resType, pWin->scrim.resNum,
			pWin->scrim.cel, TRUE);	// copy Window::cel to temp for re-use later

		// we will use this window instead, next time
		TRACK_MEM("temp Window");	pNewWin = new Window(&pWin->scrim.rect, CI_WHITE, pWin->scrim.priority);
		pCEditor->gSaveWindow = pNewWin->gSelf;
		pNewWin->SetContext(pCEditor->gSelf);
		pNewWin->Setup();
		pNewWin->SetRes(RES_CEL, pCEditor->rNumSaveWindowCel);
		pNewWin->SetPos(10, 10);
		pNewWin->Hide();	// dont need it right now though
	}

	// boost pri of all boxes in case of label/box overlap
	for(loop1 = 0; loop1 < BoxCount; loop1++)
	{
		pBox = ADerefAs(SmartBox, gBoxes[loop1]);
		pBox->SetPri(pBox->scrim.priority + 1);
	}
	pGraphMgr->scrimList.fResortList = TRUE;
	BoxCount = 0;

	pWin = ADerefAs(Window, pDialog->gWin);
	pMouse->SetLimits(&pWin->scrim.rect);

	// make him #1 in the msg stream
	pContextMgr->lContexts.Move((void *)pDialog->gSelf, L_FRONT, NULL);

	msgMask |= E_MOUSE_UP;	// we also want these
	SetColors(CI_WHITE, CI_BLACK, CI_BLACK);
}