Commit 17c32c29 authored by devill.tamachan's avatar devill.tamachan

[追加] ミニツールバーにサイズ項目追加

parent 06a2c92c
......@@ -153,7 +153,8 @@ FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
COMBOBOX IDC_MINI_ENCODING,311,0,48,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "ReadOnly",IDC_MINI_READONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,261,2,47,10
EDITTEXT IDE_MINI_PATH,0,0,257,13,ES_CENTER | ES_AUTOHSCROLL | ES_READONLY
EDITTEXT IDE_MINI_PATH,0,0,217,13,ES_CENTER | ES_AUTOHSCROLL | ES_READONLY
EDITTEXT IDE_MINI_SIZE,218,0,40,14,ES_AUTOHSCROLL | ES_READONLY
END
......
......@@ -329,7 +329,8 @@ FONT 8, "MS Sans Serif", 400, 0, 0x1
BEGIN
COMBOBOX IDC_MINI_ENCODING,311,0,48,130,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
CONTROL "ReadOnly",IDC_MINI_READONLY,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,261,2,47,10
EDITTEXT IDE_MINI_PATH,0,0,257,13,ES_CENTER | ES_AUTOHSCROLL | ES_READONLY
EDITTEXT IDE_MINI_PATH,0,0,217,13,ES_CENTER | ES_AUTOHSCROLL | ES_READONLY
EDITTEXT IDE_MINI_SIZE,218,0,40,14,ES_AUTOHSCROLL | ES_READONLY
END
......
......@@ -36,6 +36,8 @@ public:
BEGIN_DLGRESIZE_MAP(CMiniToolbarView)
DLGRESIZE_CONTROL(IDE_MINI_PATH, DLSZ_SIZE_X | DLSZ_REPAINT)
DLGRESIZE_CONTROL(IDE_MINI_SIZE, DLSZ_MOVE_X | DLSZ_REPAINT)
// DLGRESIZE_CONTROL(IDE_MINI_DATE, DLSZ_MOVE_X | DLSZ_REPAINT)
DLGRESIZE_CONTROL(IDC_MINI_READONLY, DLSZ_MOVE_X | DLSZ_REPAINT)
DLGRESIZE_CONTROL(IDC_MINI_ENCODING, DLSZ_MOVE_X | DLSZ_REPAINT)
END_DLGRESIZE_MAP()
......@@ -114,6 +116,43 @@ public:
::SetWindowText(GetDlgItem(IDE_MINI_PATH), path);
}
void SetSize(UINT64 size)
{
//UINT64: 0 - 18,446,744,073,709,551,615
LPCTSTR arrUnit[] = {_T(""), _T("k"), _T("M"), _T("G"), _T("T"), _T("P"), _T("E")};
UINT64 prev = 0;
int k=0;
for(;size>=1000;k++)
{
prev=size;
size/=1000;
}
if(prev!=0)prev%=1000;
if(prev!=0 && (prev%10) >= 5)prev+=10;
if(prev>=1000)
{
prev-=1000;
size+=1;
}
if(prev!=0)prev/=10;
CString syosu;
syosu.Format(_T("%02I64u"), prev);
for(int i=1;i>=0;i--)
{
if(syosu[i]!=L'0')break;
syosu.Delete(i,1);
}
if(syosu.GetLength()>0)syosu.Insert(0, _T("."));
CString str;
str.Format(_T("%I64u%s %sB"), size, syosu, arrUnit[k]);
::SetWindowText(GetDlgItem(IDE_MINI_SIZE), str);
}
/* void SetDate(LPCTSTR str)
{
::SetWindowText(GetDlgItem(IDE_MINI_DATE), str);
}*/
void SetReadOnly(BOOL bReadOnly)
{
CheckDlgButton(IDC_MINI_READONLY, bReadOnly?BST_CHECKED:BST_UNCHECKED);
......@@ -129,8 +168,10 @@ public:
CBZView *pBZView = GetBZView();
if(!pBZView)return;
SetFilePath(pBZView->m_pDoc->GetFilePath());
SetReadOnly(pBZView->m_pDoc->IsReadOnly());
CBZDoc2 *pDoc = pBZView->m_pDoc;
SetFilePath(pDoc->GetFilePath());
SetSize(pDoc->GetDocSize());
SetReadOnly(pDoc->IsReadOnly());
SetEncoding(pBZView->m_charset);
}
......
......@@ -61,6 +61,8 @@
#define IDC_MINI_ENCODING 1046
#define IDC_MINI_READONLY 1048
#define IDE_MINI_PATH 1049
#define IDE_MINI_SIZE 1050
#define IDE_MINI_DATE 1051
#define IDS_COLOR_ADDRESS 3000
#define IDS_COLOR_ADDRESS2 3001
#define IDS_COLOR_TEXT 3002
......@@ -163,7 +165,7 @@
#define _APS_3D_CONTROLS 1
#define _APS_NEXT_RESOURCE_VALUE 147
#define _APS_NEXT_COMMAND_VALUE 32860
#define _APS_NEXT_CONTROL_VALUE 1050
#define _APS_NEXT_CONTROL_VALUE 1051
#define _APS_NEXT_SYMED_VALUE 107
#endif
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment