| 1 | /* |
|---|
| 2 | ----------------------------------------------------------------------------- |
|---|
| 3 | This source file is part of LEXIExporter |
|---|
| 4 | |
|---|
| 5 | Copyright 2006 NDS Limited |
|---|
| 6 | |
|---|
| 7 | Author(s): |
|---|
| 8 | Lasse Tassing |
|---|
| 9 | |
|---|
| 10 | This program is free software; you can redistribute it and/or modify it under |
|---|
| 11 | the terms of the GNU Lesser General Public License as published by the Free Software |
|---|
| 12 | Foundation; either version 2 of the License, or (at your option) any later |
|---|
| 13 | version. |
|---|
| 14 | |
|---|
| 15 | This program is distributed in the hope that it will be useful, but WITHOUT |
|---|
| 16 | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS |
|---|
| 17 | FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. |
|---|
| 18 | |
|---|
| 19 | You should have received a copy of the GNU Lesser General Public License along with |
|---|
| 20 | this program; if not, write to the Free Software Foundation, Inc., 59 Temple |
|---|
| 21 | Place - Suite 330, Boston, MA 02111-1307, USA, or go to |
|---|
| 22 | http://www.gnu.org/copyleft/lesser.txt. |
|---|
| 23 | ----------------------------------------------------------------------------- |
|---|
| 24 | */ |
|---|
| 25 | #ifndef __NDS_LexiExporter_AddMultipleDialog__ |
|---|
| 26 | #define __NDS_LexiExporter_AddMultipleDialog__ |
|---|
| 27 | |
|---|
| 28 | // |
|---|
| 29 | class CAddMultipleDlg : public GDI::Dialog |
|---|
| 30 | { |
|---|
| 31 | public: |
|---|
| 32 | // Struct to hold information about each item in listbox (custom drawed) |
|---|
| 33 | struct SListItem |
|---|
| 34 | { |
|---|
| 35 | INode* pNode; |
|---|
| 36 | SClass_ID NodeClassID; |
|---|
| 37 | std::string sNodeName; |
|---|
| 38 | int ExportType; |
|---|
| 39 | bool bCanEdit; |
|---|
| 40 | }; |
|---|
| 41 | |
|---|
| 42 | CAddMultipleDlg(Window* pParent, CExporterPropertiesDlg *pOwner, CExportObject *pRootObject); |
|---|
| 43 | ~CAddMultipleDlg(); |
|---|
| 44 | |
|---|
| 45 | // If dialog returns IDOK, a list of export items can be retrieved from this function |
|---|
| 46 | vector<SListItem*> GetExportItems(); |
|---|
| 47 | |
|---|
| 48 | protected: |
|---|
| 49 | virtual void OnInitDialog(); |
|---|
| 50 | |
|---|
| 51 | // Custom drawed listbox |
|---|
| 52 | GDI::ListBox m_ListBox; |
|---|
| 53 | |
|---|
| 54 | // Dropdown listbox |
|---|
| 55 | GDI::ListBox m_TypePopup; |
|---|
| 56 | SListItem* m_pEditItem; |
|---|
| 57 | |
|---|
| 58 | // Parent ExportObject |
|---|
| 59 | CExportObject* m_pRootObject; |
|---|
| 60 | |
|---|
| 61 | // |
|---|
| 62 | CExporterPropertiesDlg *m_pOwner; |
|---|
| 63 | |
|---|
| 64 | // Icons for item list |
|---|
| 65 | HIMAGELIST m_hImageList; |
|---|
| 66 | std::map<SClass_ID, unsigned int> m_ImageListMap; |
|---|
| 67 | |
|---|
| 68 | // Selected items |
|---|
| 69 | vector<CAddMultipleDlg::SListItem*> m_lSelectedItems; |
|---|
| 70 | |
|---|
| 71 | // Original Client Rectangle (initialize in OnInitDialog()) |
|---|
| 72 | RECT m_OrgClientRect; |
|---|
| 73 | |
|---|
| 74 | // Windows callback function |
|---|
| 75 | static INT_PTR CALLBACK DlgProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam); |
|---|
| 76 | |
|---|
| 77 | // Invoked when each item in the listbox should be redrawed |
|---|
| 78 | INT_PTR OnDrawItem(LPDRAWITEMSTRUCT pCD); |
|---|
| 79 | |
|---|
| 80 | // Handle size changes |
|---|
| 81 | void OnSize(); |
|---|
| 82 | |
|---|
| 83 | // |
|---|
| 84 | void MakeResult(); |
|---|
| 85 | |
|---|
| 86 | // |
|---|
| 87 | void CloseTypePopup(); |
|---|
| 88 | |
|---|
| 89 | // |
|---|
| 90 | void OnTypeSelChange(); |
|---|
| 91 | |
|---|
| 92 | // Called when user clicks on listbox |
|---|
| 93 | void OnChildClick(POINT &pt); |
|---|
| 94 | |
|---|
| 95 | // Generate list of selected MAX objects and add them to listbox as SListItem(s) |
|---|
| 96 | void PopulateView(void); |
|---|
| 97 | }; |
|---|
| 98 | |
|---|
| 99 | // |
|---|
| 100 | |
|---|
| 101 | #endif // __NDS_LexiExporter_SelectNodeDialog__ |
|---|