OSDN Git Service

2011/11/15 23:44:38
authorqwerty2501 <riot313@gmail.com>
Tue, 15 Nov 2011 14:44:38 +0000 (23:44 +0900)
committerqwerty2501 <riot313@gmail.com>
Tue, 15 Nov 2011 14:44:38 +0000 (23:44 +0900)
nlite/nlite_commentview.h
nlite/nlite_common.h
nlite/nlite_listviewex.h

index 1b7b770..5c5c420 100644 (file)
@@ -10,6 +10,8 @@ namespace nlite{
 
                private:
                        mpool_t *pool;
+                       
+                       
 
                public:
                        CCommentList()
@@ -23,14 +25,28 @@ namespace nlite{
        private:
                const UINT menuOrID;
                CCommentList commentlist;
-       
+               UINT_PTR headerHol[5];
+               UINT_PTR columnHolSizeSum;
                
 
-
        public:
 
                CCommentView()
-                       :menuOrID(256){}
+                       :menuOrID(256),
+                       columnHolSizeSum(0)
+               {
+                       ZeroMemory(headerHol,sizeof(headerHol));
+               }
+
+
+               VOID SetHeaderSize(UINT_PTR first,UINT_PTR second,UINT_PTR third,UINT_PTR forth,UINT_PTR fifth){
+
+                       headerHol[0] = first;
+                       headerHol[1] = second;
+                       headerHol[2] = third;
+                       headerHol[3] = forth;
+                       headerHol[4] = fifth;
+               }
 
                HWND Create(HWND hWndParent){
 
@@ -48,8 +64,9 @@ namespace nlite{
                        for(UINT_PTR index = 0;index < ARRAY_LENGTH(columns) ;++index){
 
                                GetTextExtentPoint32(hdc , columns[index] , _tcslen(columns[index]) , &size);
-                               holizenSize[index] += size.cx + 15;
-                               columnHolSizeSum += holizenSize[index];
+                               UINT_PTR holsize = holizenSize[index] + size.cx + 15;
+                               holizenSize[index] = headerHol[index] > 0 ? headerHol[index] : holsize;
+                               columnHolSizeSum += holsize > holizenSize[index] ? holsize : holizenSize[index];
                        }
 
                        SelectObject(hdc,hOld);
@@ -58,13 +75,17 @@ namespace nlite{
                        
                        
                        HEADERSINFO headersinfo = {columns,holizenSize,ARRAY_LENGTH(columns)};
-                       
-                       
 
                        AddHeader(&headersinfo);
 
                        return rslt;
                }
+
+       public:
+               UINT_PTR GetColumnHolSizeSum(){
+
+                       return columnHolSizeSum;
+               }
        
        };
 }
index bfce6b9..0945cc0 100644 (file)
@@ -9,9 +9,10 @@ namespace nlite{
 
        }HEADERSINFO,*LPHEADERSINFO;
 
+       class Property{
 
-       typedef struct {
 
 
-       }PROPERTY,*LPPROPERTY;
+       };
+       
 }
\ No newline at end of file
index c802434..af11f1e 100644 (file)
@@ -17,7 +17,7 @@ namespace nlite{
 
                CHeaderCtrl header;
                CListBox  listBox;
-               UINT_PTR columnHolSizeSum;
+               
                const UINT headerID;
                const UINT listBoxID;
                HFONT hHeaderFontNew;
@@ -25,7 +25,6 @@ namespace nlite{
        public:
 
                CListViewEx():
-                       columnHolSizeSum(0),
                        headerID(257),
                        listBoxID(258){
 
@@ -159,11 +158,7 @@ namespace nlite{
                }
 
 
-       public:
-               UINT_PTR GetColumnHolSizeSum(){
 
-                       return columnHolSizeSum;
-               }
 
 
        };