void ExportPaneFactories(INameSpace* pns) { // // Display sides // pns->AddMember("SideLeft", new Number((float)ATLeft )); pns->AddMember("SideTopLeft", new Number((float)ATTopLeft )); pns->AddMember("SideTop", new Number((float)ATTop )); pns->AddMember("SideTopRight", new Number((float)ATTopRight )); pns->AddMember("SideRight", new Number((float)ATRight )); pns->AddMember("SideBottomRight", new Number((float)ATBottomRight)); pns->AddMember("SideBottom", new Number((float)ATBottom )); pns->AddMember("SideBottomLeft", new Number((float)ATBottomLeft )); pns->AddMember("SideCenter", new Number((float)ATCenter )); // add our 'primitive' panes pns->AddMember("StringPane", new StringPaneFactory()); pns->AddMember("GaugePane", new GaugePaneFactory()); pns->AddMember("SwitchPane", new SwitchPaneFactory()); pns->AddMember("ButtonPane", new ButtonPaneFactory(GetModeler())); pns->AddMember("SoundButtonPane", new SoundButtonPaneFactory(GetModeler())); pns->AddMember("ButtonBarPane",new ButtonBarPaneFactory(GetModeler())); pns->AddMember("ImageComboPane", new ImageComboPaneFactory(GetModeler(), GetWindow()->GetPopupContainer())); pns->AddMember("StringComboPane", new StringComboPaneFactory(GetModeler(), GetWindow()->GetPopupContainer())); pns->AddMember("StringColorComboPane", new StringColorComboPaneFactory(GetModeler(), GetWindow()->GetPopupContainer())); // add our 'specialty' panes #ifndef MARKCU1 pns->AddMember("SectorMapPane", new SectorMapPaneFactory()); pns->AddMember("SectorInfoPane", new SectorInfoPaneFactory()); pns->AddMember("PartInfoPane", new PartInfoPaneFactory()); pns->AddMember("PurchasesPane", new PurchasesPaneFactory()); pns->AddMember("SelectionPane", new SelectionPaneFactory()); pns->AddMember("SelectModelPane", new SelectModelPaneFactory()); pns->AddMember("ChatListPane", new ChatListPaneFactory()); pns->AddMember("InventoryImage", new InventoryImageFactory()); #endif // KGJV #62 - Map preview pane pns->AddMember("MapPreviewPane", new MapPreviewPaneFactory(GetModeler())); // KGJV #114 - TextButtonBarPane pns->AddMember("TextButtonBarPane",new TextButtonBarPaneFactory(GetModeler())); }
CDKeyDialogImpl() { TRef<INameSpace> pns = GetModeler()->GetNameSpace("cdkeydialog"); CastTo(m_ppane, pns->FindMember("CDKeyDialog")); CastTo(m_pbuttonOK, pns->FindMember("CDKeyOkButtonPane")); CastTo(m_pbuttonCancel, pns->FindMember("CDKeyCancelButtonPane")); CastTo(m_peditPane, (Pane*)pns->FindMember("CDKeyEditPane")); m_peditPane->SetMaxLength(c_cbCDKey - 1); // mdvalley: These button events need a pointer now, as well as the class spelled out. AddEventTarget(&CDKeyDialogImpl::OnButtonOK, m_pbuttonOK->GetEventSource()); AddEventTarget(&CDKeyDialogImpl::OnButtonCancel, m_pbuttonCancel->GetEventSource()); }
HRESULT EffectApp::Initialize(const ZString& strCommandLine, HWND hWindow ) { // BT DX7 - DX7 engine doesn't take a window handle. //if( SUCCEEDED( EngineApp::Initialize( strCommandLine, hWindow ) ) ) if (SUCCEEDED(EngineApp::Initialize(strCommandLine))) { TRef<INameSpace> pnsModel = GetModeler()->GetNameSpace("model"); TRef<Number> pnumberTime; CastTo(pnumberTime, pnsModel->FindMember("time")); m_pns = GetModeler()->CreateNameSpace( "effect", pnsModel ); // // Types // m_pns->AddType("QuickChatNode", CreateIObjectMDLType("QuickChatNode" , "qcn" )); m_pns->AddType("Sound" , CreateIObjectMDLType("IObject", "sound")); // // Constructors // m_pns->AddMember("LightsGeo", new LightsFactory(GetModeler(), pnumberTime)); m_pns->AddMember("FrameData", new FrameDataFactory() ); m_pns->AddMember("GameStateContainer", new GameStateContainerFactory(GetModeler()) ); m_pns->AddMember("GameStateImage", new GameStateImageFactory() ); m_pns->AddMember("BlendColorImage", new BlendColorImageFactory() ); AddPaneFactories(m_pns, GetModeler(), GetPopupContainer(), pnumberTime); AddPagePaneFactory(m_pns, GetModeler()); AddNavPaneFactory(m_pns); return S_OK; } return E_FAIL; }
TRef<INameSpace> EffectApp::OptimizeThingGeo(const ZString& str, Geo* pgeo, Number* pnumber) { // // Get the time value // TRef<INameSpace> pnsModel = GetModeler()->GetNameSpace("model"); TRef<Number> pnumberTime; CastTo(pnumberTime, pnsModel->FindMember("time")); // // we are going to create a namespace with all the stuff needed by a ThingGeo // TRef<INameSpace> pns = GetModeler()->CreateNameSpace(str, m_pns); if (pnumber != NULL) { pns->AddMember("frame", pnumber); } // // Wrap the Geo up so we don't lose the pointer as we do optimizations // TRef<WrapGeo> pwrap = new WrapGeo(pgeo); pwrap->Update(); // // Add a LightsGeo to the Group // TRef<LightsGeo> plights = new LightsGeo(GetModeler(), pnumberTime); // // Add a list of frames // TRef<FrameDataListValue> pframes = new FrameDataListValue(); // // Extract the lights and frames // ZDebugOutput("Before Callback: " + ZString(pwrap->GetGeo()->GetNodeCount()) + "\n"); TRef<GroupGeoCallbackImpl> pcallback = new GroupGeoCallbackImpl(pframes, plights); pwrap->GetGeo()->CallGroupGeoCallback(Matrix::GetIdentity(), pcallback); // // If there are any lights or frames add them to the namespace // if (plights->GetCount() > 0) { pns->AddMember("lights", plights); } if (pframes->GetList().GetCount() > 0) { pns->AddMember("frames", pframes); } // // Optimize the geo // bool bAnyFold; TRef<Geo> pgeoFold; do { bAnyFold = false; ZDebugOutput("Before RemoveMaterial: " + ZString(pwrap->GetGeo()->GetNodeCount()) + "\n"); pgeoFold = pwrap->GetGeo()->RemoveMaterial(); if (pgeoFold) { bAnyFold = true; pwrap->SetGeo(pgeoFold); ZDebugOutput("Before Fold: " + ZString(pwrap->GetGeo()->GetNodeCount()) + "\n"); pwrap->GetGeo()->DoFold(); } ZDebugOutput("Before FoldTexture: " + ZString(pwrap->GetGeo()->GetNodeCount()) + "\n"); pgeoFold = pwrap->GetGeo()->FoldTexture(); if (pgeoFold) { bAnyFold = true; pwrap->SetGeo(pgeoFold); ZDebugOutput("Before Fold: " + ZString(pwrap->GetGeo()->GetNodeCount()) + "\n"); pwrap->GetGeo()->DoFold(); } if (!bAnyFold) { ZDebugOutput("Before Fold: " + ZString(pwrap->GetGeo()->GetNodeCount()) + "\n"); bAnyFold = pwrap->GetGeo()->DoFold(); } } while (bAnyFold); ZDebugOutput("After Optimization: " + ZString(pwrap->GetGeo()->GetNodeCount()) + "\n"); // // We're done // pns->AddMember("object", pwrap->GetGeo()); return pns; }
ListPaneOldImpl(WinPoint size, int nItemHeight, bool bScroll, Pane* ppane) : m_iSelItem(-1), m_iTopItem(0), m_nItemHeight(nItemHeight), m_bMouseSel(false) { m_nItemWidth = size.X(); m_pEventSource = new IntegerEventSourceImpl(); m_pRightClickEventSource = new IntegerEventSourceImpl(); // TE: Initialized RightClick event m_pDoubleClickEventSource = new IntegerEventSourceImpl(); // TE: Initialized RightClick event m_pMouseOverEventSource = new IntegerEventSourceImpl(); m_pEventScroll = new EventSourceImpl(); m_cVisibleItems = size.Y()/nItemHeight; TRef<RowPane> pRowPane = new RowPane(); m_pBlankPane = new Pane(); InternalSetSize(m_pBlankPane, size); pRowPane->InsertAtBottom(m_pBlankPane); // Add the scroll bar TRef<Modeler> pModeler = GetModeler(); TRef<Image> pImageUp = pModeler->LoadImage(AWF_CONTROL_UP_ARROW, true); TRef<Image> pImageUpSel = pModeler->LoadImage(AWF_CONTROL_SELECTED_UP_ARROW, true); TRef<Image> pImageDown = pModeler->LoadImage(AWF_CONTROL_DOWN_ARROW, true); TRef<Image> pImageDownSel = pModeler->LoadImage(AWF_CONTROL_SELECTED_DOWN_ARROW, true); TRef<ButtonPane> pbuttonUp = CreateButton(new ImagePane(pImageUp), new ImagePane(pImageUpSel), false, 0.1f, 0.5f); TRef<ButtonPane> pbuttonDown = CreateButton(new ImagePane(pImageDown), new ImagePane(pImageDownSel), false, 0.1f, 0.5f); if (bScroll) { m_pScrollPane = CreateScrollPane( new ColumnPane(),//new BorderPane(0, MakeColorFromCOLORREF(TrekResources::BlackColor())), ThumbPane::Create(pModeler, false, NULL), pbuttonUp, pbuttonUp->GetEventSource(), pbuttonDown, pbuttonDown->GetEventSource(), false, 0.25f, 1, 1, 1, 1 ); // mdvalley: another pointer &ClassName AddEventTarget(&ListPaneOldImpl::OnScroll, m_pScrollPane->GetEventSource()); m_pScrollPane->SetPageSize(m_cVisibleItems); m_pScrollPane->SetSize(0); m_pScrollBar = //new EdgePane( new JustifyPane( JustifyPane::Center, WinPoint(17, size.Y()-2), m_pScrollPane)); //new EdgePane( m_pScrollPane;// ); TRef<ColumnPane> pcol = new ColumnPane(); if (ppane) { pcol->InsertAtBottom(ppane); } pcol->InsertAtBottom(m_pScrollBar); pcol->InsertAtBottom(new Pane(NULL, WinPoint(0, 8))); pRowPane->InsertAtBottom(pcol); } InsertAtBottom(pRowPane); }