root/trunk/CodeBrowsingDlg.cpp

Revision 5, 4.2 kB (checked in by qbert, 6 years ago)

Initial ( and last :( ) commit

Line 
1 // CodeBrowsingDlg.cpp : implementation file
2 //
3
4 #include "stdafx.h"
5 #include "Elephant.h"
6 #include "CodeBrowsingDlg.h"
7
8 #ifdef _DEBUG
9 #define new DEBUG_NEW
10 #undef THIS_FILE
11 static char THIS_FILE[] = __FILE__;
12 #endif
13
14 /////////////////////////////////////////////////////////////////////////////
15 // CCodeBrowsingDlg dialog
16
17
18 CCodeBrowsingDlg::CCodeBrowsingDlg(CWnd* pParent /*=NULL*/)
19     : CDialog(CCodeBrowsingDlg::IDD, pParent)
20 {
21     //{{AFX_DATA_INIT(CCodeBrowsingDlg)
22         // NOTE: the ClassWizard will add member initialization here
23     //}}AFX_DATA_INIT
24 }
25
26
27 void CCodeBrowsingDlg::DoDataExchange(CDataExchange* pDX)
28 {
29     CDialog::DoDataExchange(pDX);
30     //{{AFX_DATA_MAP(CCodeBrowsingDlg)
31     DDX_Control(pDX, IDC_TREE1, m_tagTree);
32     DDX_Control(pDX, IDC_COMBO1, m_tagType);
33     //}}AFX_DATA_MAP
34 }
35
36
37 BEGIN_MESSAGE_MAP(CCodeBrowsingDlg, CDialog)
38     //{{AFX_MSG_MAP(CCodeBrowsingDlg)
39     ON_WM_SIZE()       
40     //}}AFX_MSG_MAP
41 END_MESSAGE_MAP()
42
43 /////////////////////////////////////////////////////////////////////////////
44 // CCodeBrowsingDlg message handlers
45
46 void CCodeBrowsingDlg::OnSize(UINT nType, int cx, int cy)
47 {
48    
49     Invalidate();
50     CDialog::OnEraseBkgnd(GetDC());
51     CDialog::OnSize(nType, cx, cy);
52    
53     m_tagType.MoveWindow(0,0,cx,cy);   
54     CRect rect;
55     m_tagType.GetClientRect(&rect);
56     m_tagTree.MoveWindow(0,(rect.bottom - rect.top) + 5 ,cx ,cy - ( (rect.bottom - rect.top)  + 5 )  );     
57 }
58
59 BOOL CCodeBrowsingDlg::PreTranslateMessage(MSG* pMsg)
60 {
61     // TODO: Add your specialized code here and/or call the base class
62    
63     return Globals::theApp.m_pMainWnd->PreTranslateMessage(pMsg);
64 }
65
66 BOOL CCodeBrowsingDlg::OnInitDialog()
67 {
68     CDialog::OnInitDialog();
69
70     CFont font;
71     font.CreateFont(
72         12,                        // nHeight
73         0,                         // nWidth
74         0,                         // nEscapement
75         0,                         // nOrientation
76         FW_NORMAL,                 // nWeight
77         FALSE,                     // bItalic
78         FALSE,                     // bUnderline
79         0,                         // cStrikeOut
80         ANSI_CHARSET,              // nCharSet
81         OUT_DEFAULT_PRECIS,        // nOutPrecision
82         CLIP_DEFAULT_PRECIS,       // nClipPrecision
83         DEFAULT_QUALITY,           // nQuality
84         DEFAULT_PITCH | FF_SWISS,  // nPitchAndFamily
85         "Verdana");                 // lpszFacename
86    
87    
88    
89     if ( !m_imageList.Create( 16, 16, ILC_COLOR24 | ILC_MASK, 1, 1 ) )
90     {
91         TRACE0("Failed to create image list.\n");
92         return -1;
93     }
94    
95     m_bitmap.LoadBitmap( PARSER_ENTITIES_BMP );
96     m_imageList.Add( &m_bitmap, RGB( 0x00,0xff,0x00 ) );
97    
98     m_tagTree.SetImageList( &m_imageList, TVSIL_NORMAL );
99    
100    
101     m_tagType.SetImageList( &m_imageList );
102     m_tagType.SetColumnCount(0);
103     m_tagType.SetColumnWidth(0,100);
104    
105     //m_fileTagComboBox.DisableFlatLook(false);
106     m_tagType.SetFont(&font );
107    
108    
109     m_tagType.AddString("Modules");
110     m_tagType.SetItemImage(0,0);
111     m_tagType.AddString("Classes");
112     m_tagType.SetItemImage(1,3);
113     m_tagType.AddString("Intefaces");
114     m_tagType.SetItemImage(2,1);
115     m_tagType.AddString("Structs");
116     m_tagType.SetItemImage(3,2);
117     m_tagType.AddString("Functions");
118     m_tagType.SetItemImage(4,13);
119     m_tagType.AddString("Templates");
120     m_tagType.SetItemImage(5,15);
121     m_tagType.AddString("Mixins");
122     m_tagType.SetItemImage(6,15);
123     m_tagType.AddString("Typedefs");
124     m_tagType.SetItemImage(7,9);
125     m_tagType.AddString("Aliases");
126     m_tagType.SetItemImage(8,9);
127     m_tagType.AddString("Enums");
128     m_tagType.SetItemImage(9,5);
129     m_tagType.AddString("Function Literals");
130     m_tagType.SetItemImage(10,13);
131     m_tagType.AddString("Invariants");
132     m_tagType.SetItemImage(11,6);
133     m_tagType.AddString("UnitTests");   
134     m_tagType.SetItemImage(12,6);
135     m_tagType.AddString("Imports");
136     m_tagType.SetItemImage(13,6);
137     //m_tagType.AddString("Link Declarations");
138     m_tagType.AddString("Version Declarations");
139     m_tagType.SetItemImage(14,6);
140     m_tagType.AddString("Debug Declarations");
141     m_tagType.SetItemImage(15,6);
142     m_tagType.AddString("Static Constructors");
143     m_tagType.SetItemImage(16,9);
144     m_tagType.AddString("Static Deathtractors");
145     m_tagType.SetItemImage(17,12);
146
147     m_tagType.SetCurSel(0);
148
149     font.Detach();
150    
151
152
153     return TRUE;  // return TRUE unless you set the focus to a control
154     // EXCEPTION: OCX Property Pages should return FALSE
155 }
Note: See TracBrowser for help on using the browser.