00001 /* 00002 * Copyright 2003, 2004 Martin Fuchs 00003 * 00004 * This library is free software; you can redistribute it and/or 00005 * modify it under the terms of the GNU Lesser General Public 00006 * License as published by the Free Software Foundation; either 00007 * version 2.1 of the License, or (at your option) any later version. 00008 * 00009 * This library is distributed in the hope that it will be useful, 00010 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00011 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00012 * Lesser General Public License for more details. 00013 * 00014 * You should have received a copy of the GNU Lesser General Public 00015 * License along with this library; if not, write to the Free Software 00016 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00017 */ 00018 00019 00020 // 00021 // Explorer clone 00022 // 00023 // pane.h 00024 // 00025 // Martin Fuchs, 23.07.2003 00026 // 00027 00028 00029 #define IDW_TREE_LEFT 3 00030 #define IDW_TREE_RIGHT 6 00031 #define IDW_HEADER_LEFT 2 00032 #define IDW_HEADER_RIGHT 5 00033 00034 00035 enum COLUMN_FLAGS { 00036 COL_TYPE = 0x0001, 00037 COL_SIZE = 0x0002, 00038 COL_DATE = 0x0004, 00039 COL_TIME = 0x0008, 00040 COL_ATTRIBUTES = 0x0010, 00041 COL_DOSNAMES = 0x0020, 00042 COL_INDEX = 0x0040, 00043 COL_LINKS = 0x0080, 00044 COL_CONTENT = 0x0100, 00045 COL_ALL = COL_TYPE|COL_SIZE|COL_DATE|COL_TIME|COL_ATTRIBUTES|COL_DOSNAMES|COL_INDEX|COL_LINKS|COL_CONTENT 00046 }; 00047 00048 00049 /// Worker for drawing contents of file lists in child pane 00050 struct OutputWorker 00051 { 00052 OutputWorker(); 00053 00054 void init_output(HWND hwnd); 00055 void output_text(LPDRAWITEMSTRUCT dis, int* positions, int col, LPCTSTR str, DWORD flags); 00056 void output_tabbed_text(LPDRAWITEMSTRUCT dis, int* positions, int col, LPCTSTR str); 00057 void output_number(LPDRAWITEMSTRUCT dis, int* positions, int col, LPCTSTR str); 00058 00059 SIZE _spaceSize; 00060 TCHAR _num_sep; 00061 HFONT _hfont; 00062 }; 00063 00064 00065 /// child window pane for displaying file lists 00066 struct Pane : public SubclassedWindow 00067 { 00068 typedef SubclassedWindow super; 00069 00070 Pane(HWND hparent, int id, int id_header, Entry* rool, bool treePane, int visible_cols); 00071 ~Pane(); 00072 00073 #define COLUMNS 12 00074 int _widths[COLUMNS]; 00075 int _positions[COLUMNS+1]; 00076 00077 WindowHandle _hwndHeader; 00078 00079 Entry* _root; 00080 Entry* _cur; 00081 00082 COLORREF _clrCompressed; 00083 00084 int _visible_cols; 00085 bool _treePane; 00086 00087 void init(); 00088 void set_header(); 00089 bool create_header(HWND parent, int id); 00090 00091 bool calc_widths(bool anyway); 00092 void calc_single_width(int col); 00093 void draw_item(LPDRAWITEMSTRUCT dis, Entry* entry, int calcWidthCol=-1); 00094 00095 int insert_entries(Entry* dir, int idx=-1); 00096 BOOL command(UINT cmd); 00097 virtual int Notify(int id, NMHDR* pnmh); 00098 00099 protected: 00100 virtual LRESULT WndProc(UINT nmsg, WPARAM wparam, LPARAM lparam); 00101 00102 void calc_width(LPDRAWITEMSTRUCT dis, int col, LPCTSTR str); 00103 void calc_tabbed_width(LPDRAWITEMSTRUCT dis, int col, LPCTSTR str); 00104 struct MainFrameBase* get_frame(); 00105 00106 protected: 00107 HIMAGELIST _himl; 00108 OutputWorker _out_wrkr; 00109 }; 00110
ROS Explorer Source Code Documentation
generated on 02.01.2013 by ![]() |