OSDN Git Service

SyncDlg show animate when press push button and hide input control.
authorFrank Li <lznuaa@gmail.com>
Tue, 21 Jul 2009 15:59:51 +0000 (23:59 +0800)
committerFrank Li <lznuaa@gmail.com>
Tue, 21 Jul 2009 15:59:51 +0000 (23:59 +0800)
src/Resources/TortoiseProcENG.rc
src/TortoiseProc/SyncDlg.cpp
src/TortoiseProc/SyncDlg.h

index c0a76cd..c1f17ac 100644 (file)
Binary files a/src/Resources/TortoiseProcENG.rc and b/src/Resources/TortoiseProcENG.rc differ
index 7a04f71..f5be994 100644 (file)
@@ -81,7 +81,7 @@ void CSyncDlg::OnBnClickedButtonPush()
 {\r
        // TODO: Add your control notification handler code here\r
        this->m_regPushButton=this->m_ctrlPush.GetCurrentEntry();\r
-\r
+       this->SwitchToRun();\r
 }\r
 \r
 void CSyncDlg::OnBnClickedButtonApply()\r
@@ -93,11 +93,43 @@ void CSyncDlg::OnBnClickedButtonEmail()
 {\r
        // TODO: Add your control notification handler code here\r
 }\r
-\r
+void CSyncDlg::ShowProgressCtrl(bool bShow)\r
+{\r
+       int b=bShow?SW_NORMAL:SW_HIDE;\r
+       this->m_ctrlAnimate.ShowWindow(b);\r
+       this->m_ctrlProgress.ShowWindow(b);\r
+       this->m_ctrlAnimate.Open(IDR_DOWNLOAD);\r
+       if(b == SW_NORMAL)\r
+               this->m_ctrlAnimate.Play(0,-1,-1);\r
+       else\r
+               this->m_ctrlAnimate.Stop();\r
+}\r
+void CSyncDlg::ShowInputCtrl(bool bShow)\r
+{\r
+       int b=bShow?SW_NORMAL:SW_HIDE;\r
+       this->m_ctrlURL.ShowWindow(b);\r
+       this->m_ctrlLocalBranch.ShowWindow(b);\r
+       this->m_ctrlRemoteBranch.ShowWindow(b);\r
+       this->GetDlgItem(IDC_BUTTON_LOCAL_BRANCH)->ShowWindow(b);\r
+       this->GetDlgItem(IDC_BUTTON_REMOTE_BRANCH)->ShowWindow(b);\r
+       this->GetDlgItem(IDC_STATIC_LOCAL_BRANCH)->ShowWindow(b);\r
+       this->GetDlgItem(IDC_STATIC_REMOTE_BRANCH)->ShowWindow(b);\r
+       this->GetDlgItem(IDC_BUTTON_MANAGE)->ShowWindow(b);\r
+       this->GetDlgItem(IDC_CHECK_PUTTY_KEY)->ShowWindow(b);\r
+       this->GetDlgItem(IDC_CHECK_FORCE)->ShowWindow(b);\r
+       this->GetDlgItem(IDC_STATIC_REMOTE_URL)->ShowWindow(b);\r
+       \r
+}\r
 BOOL CSyncDlg::OnInitDialog()\r
 {\r
        CResizableStandAloneDialog::OnInitDialog();\r
 \r
+       /*\r
+       this->m_ctrlAnimate.ShowWindow(SW_NORMAL);\r
+       this->m_ctrlAnimate.Open(IDR_DOWNLOAD);\r
+       this->m_ctrlAnimate.Play(0,-1,-1);\r
+    */\r
+\r
        //Create Tabctrl\r
        CWnd *pwnd=this->GetDlgItem(IDC_BUTTON_TABCTRL);\r
        CRect rectDummy;\r
@@ -147,11 +179,11 @@ BOOL CSyncDlg::OnInitDialog()
        AddAnchor(IDC_BUTTON_PUSH,BOTTOM_LEFT);\r
        AddAnchor(IDC_BUTTON_APPLY,BOTTOM_LEFT);\r
        AddAnchor(IDC_BUTTON_EMAIL,BOTTOM_LEFT);\r
-       AddAnchor(IDC_PROGRESS_SYNC,BOTTOM_LEFT,BOTTOM_RIGHT);\r
+       AddAnchor(IDC_PROGRESS_SYNC,TOP_LEFT,TOP_RIGHT);\r
        AddAnchor(IDOK,BOTTOM_RIGHT);\r
        AddAnchor(IDHELP,BOTTOM_RIGHT);\r
        AddAnchor(IDC_STATIC_STATUS,BOTTOM_LEFT);\r
-       AddAnchor(IDC_ANIMATE_SYNC,TOP_RIGHT);\r
+       AddAnchor(IDC_ANIMATE_SYNC,TOP_LEFT);\r
        \r
        BRANCH_COMBOX_ADD_ANCHOR();\r
 \r
index f1ead82..5c445ac 100644 (file)
@@ -79,6 +79,11 @@ protected:
        \r
        CString m_OutLocalBranch;\r
        CString m_OutRemoteBranch;\r
+       \r
+       void ShowProgressCtrl(bool bShow=true);\r
+       void ShowInputCtrl(bool bShow=true);\r
+       void SwitchToRun(){ShowProgressCtrl(true);ShowInputCtrl(false);}\r
+       void SwitchToInput(){ShowProgressCtrl(false);ShowInputCtrl(true);}\r
 \r
        DECLARE_MESSAGE_MAP()\r
 public:\r