Exemple #1
0
//---------------------------------------------------------------------------
// ページの削除
void __fastcall TFileViewDlg::KDPClick(TObject *Sender)
{
	if( m_MaxPage <= 1 ) return;

	AnsiString as;
	GetPageName(as, m_CurPage);
	if( YesNoMB( MsgEng ? "Delete '%s', are you sure?" : "'%s'を削除します. よろしいですか?", as.c_str()) != IDYES ) return;

	m_CurFile = -1;
	pFileV[m_CurPage]->Delete();
	if( m_CurPage < (m_MaxPage - 1) ){  // 途中のページ
		int i;
		for( i = m_CurPage; i < (m_MaxPage - 1); i++ ){
			pFileV[i] = pFileV[i+1];
		}
		pFileV[i] = NULL;
	}
	else {                              // 最後のページ
		pFileV[m_CurPage] = NULL;
		m_CurPage--;
	}
	m_MaxPage--;
	pCurPage = pFileV[m_CurPage];
	Mmsstv->ReOpenFileView(this);
}
Exemple #2
0
//---------------------------------------------------------------------------
void __fastcall TFileViewDlg::KRPClick(TObject *Sender)
{
	AnsiString as = pCurPage->m_Name;
	if( InputMB(NULL, MsgEng ? "Enter page name" : "名前を入力", as) == TRUE ){
		pCurPage->m_Name = as.c_str();
		GetPageName(as, m_CurPage);
		pTabS->Tabs->Strings[m_CurPage] = as;
	}
}
Exemple #3
0
void GamePageSupplyDepot::Clear(MkDataNode* sharingNode)
{
	if (GameSharedUI::SystemCB != NULL)
	{
		GameSharedUI::SystemCB->DetachFromParentNode();
	}

	MK_WIN_EVENT_MGR.RemoveWindow(GetPageName());
}
Exemple #4
0
bool GamePageBase::SetUp(MkDataNode& sharingNode)
{
	if (!MkBasePage::SetUp(sharingNode))
		return false;

	m_RootSceneNode = new MkSceneNode(L"Root");
	MK_CHECK(m_RootSceneNode != NULL, GetPageName().GetString() + L" game page의 root scene node 생성 실패")
		return false;

	if (m_FinalDrawStep == NULL)
	{
		m_FinalDrawStep = dynamic_cast<MkDrawSceneNodeStep*>(MK_RENDERER.GetDrawQueue().GetStep(GlobalDef::FinalDrawStepName));
		MK_CHECK(m_FinalDrawStep != NULL, GlobalDef::FinalDrawStepName.GetString() + L" drawStep 없음")
			return false;
	}
Exemple #5
0
//---------------------------------------------------------------------------
// 新規ページの作成
void __fastcall TFileViewDlg::KNPClick(TObject *Sender)
{
	if( m_MaxPage < FPAGEMAX ){
		m_CurFile = -1;
		CFILEV *cp = new CFILEV;
		pFileV[m_MaxPage] = cp;
		m_MaxPage++;
		if( m_MaxPage <= 2 ){
			Mmsstv->ReOpenFileView(this);
		}
		else {
			AnsiString as;
			GetPageName(as, m_MaxPage - 1);
			pTabS->Tabs->Add(as);
		}
	}
}
Exemple #6
0
//---------------------------------------------------------------------------
void __fastcall TFileViewDlg::FormResize(TObject *Sender)
{
	if( m_DisEvent ) return;

	int WW = m_RectS.Right + 6;
	int HH = m_RectS.Bottom + 6;
	if( BorderStyle == bsNone ){
		int ch = m_Line * HH;
		int cw = m_Col * WW;
		m_DisEvent++;
		ClientHeight = GetCH(ch);
		ClientWidth = cw;
		m_DisEvent--;
		return;
	}
	int OldMax = m_Max;
	int h = (pTabS != NULL) ? ClientHeight - pTabS->TabHeight - 6 : ClientHeight;
	h = int((double(h - Panel->Height)/ HH) + 0.5);
	if( !h ) h = 1;
	int w = int((double(ClientWidth)/ WW) + 0.5);
	if( !w ) w = 1;
	while( (h * w) > AHDMAX ){
		if( w > 1 ){
			w--;
		}
		else if( h > 1 ){
			h--;
		}
	}
	int ch = h * HH;
	int cw = w * WW;
	if( cw < (UD->Left + UD->Width) ){
		w++;
		cw += WW;
	}
	m_Col = w;
	m_Line = h;
	m_Max = h * w;
	SetBitmapSize();
	TWinControl *pCtr = this;
	if( (m_MaxPage > 1) && (pTabS == NULL) ){
		Panel->Align = alNone;
		RemoveControl(Panel);
		pTabS = new TTabControl(this);
		pTabS->Width = ClientWidth;
		pTabS->Height = ClientHeight;
		pTabS->TabPosition = KBP->Checked ? tpBottom : tpTop;
		InsertControl(pTabS);
		pTabS->Parent = this;
		pTabS->Align = alClient;
		for( int j = 0; j < m_MaxPage; j++ ){
			AnsiString as;
			GetPageName(as, j);
			pTabS->Tabs->Add(as);
		}
		pTabS->Font->Height = -16;
		pTabS->TabHeight = 20;
		pTabS->InsertControl(Panel);
		Panel->Parent = pTabS;
		if( KBP->Checked ){
			Panel->Top = 0;
		}
		else {
			Panel->Top = pTabS->TabHeight + 3;
		}
		pTabS->TabIndex = m_CurPage;
		pTabS->OnChange = TabSChange;
		pCtr = pTabS;
	}
	pCurPage = pFileV[m_CurPage];
	if( UD->Max < pCurPage->m_CurPage ) UD->Max = SHORT(pCurPage->m_CurPage + 1);
	UD->Position = SHORT(pCurPage->m_CurPage);
	int i;
	for( i = 0; i < m_Max; i++ ){
		if( pPanel[i] == NULL ){
			pPanel[i] = new TPanel(this);
			TPanel *pn = pPanel[i];
			pn->BorderStyle = bsSingle;
			pn->Width = WW;
			pn->Height = HH;
			pCtr->InsertControl(pn);
			pn->Parent = pCtr;
			pBox[i] = new TPaintBox(this);
			TPaintBox *pb = pBox[i];
			pn->InsertControl(pb);
			pb->Parent = pn;
			pb->Align = alClient;
			pb->OnPaint = PBPaint;
			pb->OnMouseDown = PBMouseDown;
			pb->OnMouseMove = PBMouseMove;
			pb->OnDblClick = PBDblClick;
			pb->OnDragOver = PanelDragOver;
			pb->OnDragDrop = PanelDragDrop;
			pb->PopupMenu = pPopup;
		}
		else {
			pPanel[i]->Visible = FALSE;
			pPanel[i]->Width = WW;
			pPanel[i]->Height = HH;
		}
		MultProc();
	}
	for( ; i < AHDMAX; i++ ){
		if( pPanel[i] != NULL ){
			pPanel[i]->Visible = FALSE;
		}
		MultProc();
	}
	m_DisEvent++;
	ClientHeight = GetCH(ch);
	ClientWidth = cw;
	for( i = 0; i < m_Max; i++ ){
		pPanel[i]->Left = (i % m_Col) * WW;
		pPanel[i]->Top = Panel->Top + Panel->Height + (i / m_Col) * HH;
		pPanel[i]->Visible = TRUE;
	}
	if( pTabS != NULL ) Panel->Width = pTabS->ClientWidth;
	m_DisEvent--;
	if( m_Max != OldMax ){
		for( i = 0; i < m_MaxPage; i++ ){
			if( i != m_CurPage ){
				delete pFileV[i]->pList;
				pFileV[i]->pList = NULL;
			}
		}
		LoadImage();
	}
	SetPopup(Popup);
}
//------------------------------------------------------------------------------
void WizGenericSingleChoiceList::OnPageChanging(wxWizardEvent& event)
{
    WizPageBase::OnPageChanging(event); // let the base class handle it too

    // save selection value
    if (event.GetDirection() != 0 && event.IsAllowed())
    {
        Manager::Get()->GetConfigManager(_T("project_wizard"))->Write(_T("/generic_single_choices/") + GetPageName(), (int)m_pGenericSingleChoiceList->GetChoice());
    }
}
//------------------------------------------------------------------------------
void WizGenericSelectPathPanel::OnPageChanging(wxWizardEvent& event)
{
    if (event.GetDirection() != 0) // !=0 forward, ==0 backward
    {
        wxString dir = Manager::Get()->GetMacrosManager()->ReplaceMacros(m_pGenericSelectPath->txtFolder->GetValue());
        if (!wxDirExists(dir))
        {
            cbMessageBox(_("Please select a valid location..."), _("Error"), wxICON_ERROR, GetParent());
            event.Veto();
            return;
        }
    }
    WizPageBase::OnPageChanging(event); // let the base class handle it too

    if (event.GetDirection() != 0 && event.IsAllowed())
    {
        Manager::Get()->GetConfigManager(_T("project_wizard"))->Write(_T("/generic_paths/") + GetPageName(), m_pGenericSelectPath->txtFolder->GetValue());
    }
}
Exemple #9
0
int CXMLDlg::CreatePages(HTREEITEM pItem)
{
	HTREEITEM pChildItem = m_treeOutput.GetChildItem(pItem);
	if (!pChildItem)
	{
		ASSERT(false);
		return 0;
	}

	int nPages = 0;
	while (pChildItem)
	{
		CString szItemType = m_treeOutput.GetItemText(pChildItem);
		if (!szItemType.CompareNoCase(_T("page")) )
		{
			POINT Size = {0,0};
			GetCurrentObjectSize(pChildItem, Size);
			int iPageWidth = Size.x;
			int iPageHeight = Size.y;

			AGDOCTYPE Type = m_pAGDoc->GetDocType();
			POINT ptSplitOffset = {0,0};
			int iPagesToMake = 1;
			if ((Type == DOC_QUARTERCARD || Type == DOC_HALFCARD || Type == DOC_NOTECARD) && nPages == 1)
				iPagesToMake = 2;
			else
			if (Type == DOC_CALENDAR && (iPageWidth > 11*1800 || iPageHeight > 11*1800))
				iPagesToMake = 2;

			if (iPagesToMake > 1)
			{ // Split the larger dimension
				if (iPageWidth > iPageHeight)
				{
					iPageWidth /= iPagesToMake;
					ptSplitOffset.x = iPageWidth;
				}
				else
				{
					iPageHeight /= iPagesToMake;
					ptSplitOffset.y = iPageHeight;
				}
			}

			for (int i=0; i<iPagesToMake; i++)
			{
				if (Type == DOC_CALENDAR && iPagesToMake > 1)
				{
					// Special case to skip the top part of a calendar cover
					if (nPages == 0 && i == 0)
						continue;
					// Special case to skip the bottom part of a calendar back
					if (nPages == 13 && i == 1)
						continue;
				}
				CAGPage* pPage = new CAGPage(iPageWidth, iPageHeight);
				if (!pPage)
				{
					ASSERT(false);
					return nPages;
				}

				m_pAGDoc->AddPage(pPage);
				CString strPageName = GetPageName(nPages);
				pPage->SetPageName(strPageName);
				for (int j = 0; j < NLAYERS; j++)
					pPage->AddLayer(new CAGLayer());

				POINT ptOffset = {0,0};
				if (i > 0)
					ptOffset = ptSplitOffset;
				HandlePageItems(pChildItem, pPage, ptOffset);
				nPages++;
			}
		}

		pChildItem = m_treeOutput.GetNextItem(pChildItem, TVGN_NEXT);
	}

	return nPages;
}
Exemple #10
0
bool GamePageSupplyDepot::SetUp(MkDataNode& sharingNode)
{
	MK_WIN_EVENT_MGR.RegisterWindow(new GP_SupplyDepotWindow(GetPageName()), true);

	return true;
}
Exemple #11
0
bool GamePageTrainRoom::SetUp(MkDataNode& sharingNode)
{
	MK_WIN_EVENT_MGR.RegisterWindow(new GP_TrainRoomWindow(GetPageName()), true);

	return true;
}
void MkBasePage::SetPageFlowTable(const MkHashStr& condition, const MkHashStr& targetPage) const
{
	MK_PAGE_MGR.SetPageFlowTable(GetPageName(), condition, targetPage);
}
bool MkBasePage::SetMoveMessage(const MkHashStr& condition) const
{
	return (MK_PAGE_MGR.GetCurrentPageName() == GetPageName()) ? MK_PAGE_MGR.SetMoveMessage(condition) : false;
}