void CSetProxyPage::OnBnClickedEnable() { UpdateData(); if (m_isEnabled) { EnableGroup(TRUE); } else { EnableGroup(FALSE); } SetModified(); }
//--------------------------------------------------------------------------------------- void GrpRhythmicDictation::synchronize_with_selection(bool fEnable, SelectionSet* pSelection) { //TODO EnableGroup(fEnable); }
//--------------------------------------------------------------------------------------- void GrpRhythmicDictation::synchronize_with_cursor(bool fEnable, DocCursor* pCursor) { //TODO EnableGroup(fEnable); }
void DateAdjustDlg::OnSetMode() { adj_mode_ = 1; EnableGroup(false); UpdateExampleAndOkBtn(); }
void DateAdjustDlg::OnAdjustMode() { adj_mode_ = 0; EnableGroup(true); UpdateExampleAndOkBtn(); }
BOOL DateAdjustDlg::InitDlg() { if (photos_.empty()) { EndDialog(IDCANCEL); return true; } adj_mode_ = profile_adj_mode_; days_ = profile_days_; hours_ = profile_hours_; minutes_ = profile_minutes_; seconds_ = profile_seconds_; DialogChild::OnInitDialog(); SetDlgItemInt(IDC_DAYS, days_); SetDlgItemInt(IDC_HOURS, hours_); SetDlgItemInt(IDC_MINUTES, minutes_); SetDlgItemInt(IDC_SECONDS, seconds_); BuildResizingMap(); SetWndResizing(IDC_LIST, DlgAutoResize::RESIZE); SetWndResizing(IDC_HELP_BTN, DlgAutoResize::MOVE_V); SetWndResizing(IDCANCEL, DlgAutoResize::MOVE); SetWndResizing(IDOK, DlgAutoResize::MOVE); results_.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_DOUBLEBUFFER | LVS_EX_LABELTIP); //results_.InsertColumn(0, _T("File Name"), LVCFMT_LEFT, 100); results_.InsertColumn(0, _T("Existing Date/Time"), LVCFMT_LEFT, Pixels(150)); results_.InsertColumn(1, _T("New Date/Time"), LVCFMT_LEFT, Pixels(150)); results_.SetItemCount(static_cast<int>(photos_.size())); time_edit_.ModifyStyle(0, DTS_TIMEFORMAT); SubclassHelpBtn(_T("ToolDateTime.htm")); spin_days_.SetRange32(-100000, 100000); spin_hours_.SetRange32(-1000000, 1000000); spin_minutes_.SetRange32(-10000000, 10000000); spin_seconds_.SetRange32(-2000000000, 2000000000); // some reasonable text length limits (include sign, digits, and thousand separators) edit_days_.SetLimitText(8); edit_hours_.SetLimitText(16); edit_minutes_.SetLimitText(16); edit_seconds_.SetLimitText(16); // set min/max date WPARAM flags= GDTR_MIN | GDTR_MAX; SYSTEMTIME sys[2]; memset(sys, 0, sizeof(sys)); sys[0].wYear = 1601; sys[0].wMonth = 1; sys[0].wDay = 2; sys[1].wYear = 9999; sys[1].wMonth = 12; sys[1].wDay = 31; date_edit_.SendMessage(DTM_SETRANGE, flags, reinterpret_cast<LPARAM>(sys)); time_edit_.SendMessage(DTM_SETRANGE, flags, reinterpret_cast<LPARAM>(sys)); auto dt= DateTimeToSytemTime(FromISOString(profile_date_time_)); DateTime_SetSystemtime(date_edit_, GDT_VALID, &dt); DateTime_SetSystemtime(time_edit_, GDT_VALID, &dt); example_time_ = photos_.front()->GetDateTime(); ready_ = true; EnableGroup(adj_mode_ == 0); UpdateExampleAndOkBtn(); return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE }
//--------------------------------------------------------------------------------------- void GrpTopLevel::synchronize_with_selection(bool fEnable, SelectionSet* pSelection) { //TODO EnableGroup(fEnable); }
//--------------------------------------------------------------------------------------- void GrpTopLevel::synchronize_with_cursor(bool fEnable, DocCursor* pCursor) { //TODO EnableGroup(fEnable); }
INT_PTR CALLBACK DlgSkinEditorOpts(HWND hwndDlg, UINT msg, WPARAM wParam, LPARAM lParam) { switch (msg) { case WM_DESTROY: { if (object_clipboard) mir_free_and_nill(object_clipboard); break; } case WM_WINDOWPOSCHANGED: { WINDOWPOS * wp=(WINDOWPOS *)lParam; if (lParam && wp->flags&SWP_SHOWWINDOW) { if (glOtherSkinWasLoaded) { TreeView_DeleteAllItems(GetDlgItem(hwndDlg,IDC_OBJECT_TREE)); FillObjectTree(hwndDlg,IDC_OBJECT_TREE,"$$*"); glSkinWasModified=0; glOtherSkinWasLoaded=FALSE; } } break; } case WM_INITDIALOG: { TranslateDialogDefault(hwndDlg); FillObjectTree(hwndDlg,IDC_OBJECT_TREE,"$$*"); { //Fill types combo int i=0; for (i=0; i<SIZEOF(TYPES); i++) SendDlgItemMessage(hwndDlg,IDC_TYPE,CB_ADDSTRING,0,(LPARAM)TranslateTS(TYPES[i])); } { //Fill fit combo int i=0; for (i=0; i<SIZEOF(FITMODES); i++) SendDlgItemMessage(hwndDlg,IDC_FIT,CB_ADDSTRING,0,(LPARAM)TranslateTS(FITMODES[i])); } //SPIN Ranges { SendDlgItemMessage(hwndDlg,IDC_SPIN_ALPHA,UDM_SETRANGE,0,MAKELONG(255,0)); SendDlgItemMessage(hwndDlg,IDC_SPIN_ALPHA,UDM_SETPOS,0,MAKELONG(255,0)); SendDlgItemMessage(hwndDlg,IDC_SPIN_TOP,UDM_SETRANGE,0,MAKELONG(900,0)); SendDlgItemMessage(hwndDlg,IDC_SPIN_LEFT,UDM_SETRANGE,0,MAKELONG(900,0)); SendDlgItemMessage(hwndDlg,IDC_SPIN_BOTTOM,UDM_SETRANGE,0,MAKELONG(900,0)); SendDlgItemMessage(hwndDlg,IDC_SPIN_RIGHT,UDM_SETRANGE,0,MAKELONG(900,0)); SendDlgItemMessage(hwndDlg,IDC_SPIN_POSLEFT,UDM_SETRANGE,0,MAKELONG(1000,0)); SendDlgItemMessage(hwndDlg,IDC_SPIN_POSTOP,UDM_SETRANGE,0,MAKELONG(1000,0)); SendDlgItemMessage(hwndDlg,IDC_SPIN_WIDTH,UDM_SETRANGE,0,MAKELONG(1000,0)); SendDlgItemMessage(hwndDlg,IDC_SPIN_HEIGHT,UDM_SETRANGE,0,MAKELONG(1000,0)); } EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_GROUP_1),FALSE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_ST_COLOUR),FALSE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_ST_ALPHA),FALSE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_GROUP_2),FALSE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_GROUP_3),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_PASTE),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_COPY),FALSE); glSkinWasModified=0; glOtherSkinWasLoaded=FALSE; break; } case WM_COMMAND: { if (LOWORD(wParam)==IDC_TYPE) { if (HIWORD(wParam)==CBN_SELCHANGE) { int i=SendDlgItemMessage(hwndDlg,IDC_TYPE,CB_GETCURSEL,(WPARAM)0,(LPARAM)0); //if (IsWindowEnabled(GetDlgItem(hwndDlg,IDC_TYPE))) SetAppropriateGroups(hwndDlg,i); if (GetFocus()==GetDlgItem(hwndDlg,IDC_TYPE)) SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); UpdateInfo(hwndDlg); break; } } else if (LOWORD(wParam)==IDC_COPY) { if (HIWORD(wParam)==BN_CLICKED) { if (object_clipboard) mir_free_and_nill(object_clipboard); object_clipboard=NULL; { OPT_OBJECT_DATA *sd=NULL; HTREEITEM hti=TreeView_GetSelection(GetDlgItem(hwndDlg,IDC_OBJECT_TREE)); if (hti!=0) { TVITEM tvi={0}; tvi.hItem=hti; tvi.mask=TVIF_HANDLE|TVIF_PARAM; TreeView_GetItem(GetDlgItem(hwndDlg,IDC_OBJECT_TREE),&tvi); sd=(OPT_OBJECT_DATA*)(tvi.lParam); } if (sd && sd->szValue) object_clipboard=mir_strdup(sd->szValue); } EnableWindow(GetDlgItem(hwndDlg,IDC_PASTE),object_clipboard!=NULL); return 0; } } else if (LOWORD(wParam)==IDC_PASTE) { if (HIWORD(wParam)==BN_CLICKED) { if (object_clipboard) SetControls(hwndDlg, object_clipboard); SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); UpdateInfo(hwndDlg); return 0; } } else if (LOWORD(wParam)==IDC_COLOR) { SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); UpdateInfo(hwndDlg); } else if (LOWORD(wParam)==IDC_BROWSE) { if (HIWORD(wParam)==BN_CLICKED) { { char str[MAX_PATH]={0}; OPENFILENAMEA ofn={0}; char filter[512]={0}; int res=0; ofn.lStructSize = OPENFILENAME_SIZE_VERSION_400; ofn.hwndOwner = hwndDlg; ofn.hInstance = NULL; ofn.lpstrFilter = "Images (*.png,*.jpg,*.bmp,*.gif,*.tga)\0*.png;*.jpg;*.jpeg;*.bmp;*.gif;*.tga\0All files (*.*)\0*.*\0\0"; ofn.Flags = (OFN_FILEMUSTEXIST | OFN_HIDEREADONLY); SendDlgItemMessageA(hwndDlg,IDC_FILE,WM_GETTEXT,(WPARAM)SIZEOF(str),(LPARAM)str); if (str[0]=='\0' || strchr(str,'%')) { ofn.Flags|=OFN_NOVALIDATE; str[0]='\0'; } else { ske_GetFullFilename(str,str,(char*)0,TRUE); } ofn.lpstrFile = str; ofn.nMaxFile = SIZEOF(str); ofn.nMaxFileTitle = MAX_PATH; ofn.lpstrDefExt = "*.*"; // { // DWORD tick=GetTickCount(); res=GetOpenFileNameA(&ofn); // if(!res) // if (GetTickCount()-tick<100) // { // res=GetOpenFileNameA(&ofn); // if(!res) break; // } // else break; //} if (res) { GetShortFileName(ofn.lpstrFile); SendDlgItemMessageA(hwndDlg,IDC_FILE,WM_SETTEXT,(WPARAM)0,(LPARAM)ofn.lpstrFile); SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); UpdateInfo(hwndDlg); } } } } else if (LOWORD(wParam)==IDC_FILE) { if (HIWORD(wParam) == EN_CHANGE) { fileChanged=TRUE; if ((HWND)lParam != GetFocus()) { GetFileSizes(hwndDlg); fileChanged=FALSE; } } else if (HIWORD(wParam) == EN_KILLFOCUS) { if (fileChanged) { GetFileSizes(hwndDlg); fileChanged=FALSE; } } } else if (( (LOWORD(wParam)==IDC_E_TOP ||LOWORD(wParam)==IDC_E_BOTTOM ||LOWORD(wParam)==IDC_E_LEFT ||LOWORD(wParam)==IDC_E_RIGHT ||LOWORD(wParam)==IDC_E_X ||LOWORD(wParam)==IDC_E_Y ||LOWORD(wParam)==IDC_E_W ||LOWORD(wParam)==IDC_E_H ||LOWORD(wParam)==IDC_EDIT_ALPHA ) && HIWORD(wParam) != EN_CHANGE || (HWND)lParam != GetFocus())) { return 0; } else if (LOWORD(wParam)!=IDC_EDIT1) { SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); UpdateInfo(hwndDlg); } //check (LOWORD(wParam)) //SendMessage(GetParent(hwndDlg), PSM_CHANGED, 0, 0); break; } case WM_NOTIFY: switch (((LPNMHDR)lParam)->idFrom) { case IDC_OBJECT_TREE: { //Save existed object //Change to new object NMTREEVIEWA * nmtv = (NMTREEVIEWA *) lParam; if (!nmtv) return 0; if (nmtv->hdr.code==TVN_SELCHANGEDA || nmtv->hdr.code==TVN_SELCHANGEDW) { if (nmtv->itemOld.lParam) { OPT_OBJECT_DATA * dataOld=(OPT_OBJECT_DATA*)nmtv->itemOld.lParam; if (dataOld->szValue) { mir_free_and_nill(dataOld->szValue); dataOld->szValue=MadeString(hwndDlg); } } if (nmtv->itemNew.lParam) { OPT_OBJECT_DATA * data=(OPT_OBJECT_DATA*)nmtv->itemNew.lParam; char buf[255]; mir_snprintf(buf,SIZEOF(buf),"%s=%s",data->szName, data->szValue); SendDlgItemMessageA(hwndDlg,IDC_EDIT1,WM_SETTEXT,0,(LPARAM)buf); SetControls(hwndDlg,data->szValue); EnableWindow(GetDlgItem(hwndDlg,IDC_COPY),TRUE); EnableWindow(GetDlgItem(hwndDlg,IDC_PASTE),object_clipboard!=NULL); } else { SendDlgItemMessageA(hwndDlg,IDC_EDIT1,WM_SETTEXT,0,(LPARAM)""); SetControls(hwndDlg,NULL); EnableWindow(GetDlgItem(hwndDlg,IDC_COPY),FALSE); EnableWindow(GetDlgItem(hwndDlg,IDC_PASTE),FALSE); } } else if (nmtv->hdr.code==TVN_DELETEITEMA) { OPT_OBJECT_DATA * dataOld=(OPT_OBJECT_DATA*)nmtv->itemOld.lParam; if (dataOld) { if (dataOld->szName) mir_free_and_nill(dataOld->szName); if (dataOld->szPath) mir_free_and_nill(dataOld->szPath); if (dataOld->szTempValue) mir_free_and_nill(dataOld->szTempValue); if (dataOld->szValue) mir_free_and_nill(dataOld->szValue); } } return 0; } case 0: switch (((LPNMHDR)lParam)->code) { case PSN_APPLY: if (!glOtherSkinWasLoaded) //store only if skin is same { StoreTreeToDB(GetDlgItem(hwndDlg,IDC_OBJECT_TREE),SKIN); //ReloadSkin ske_LoadSkinFromDB(); pcli->pfnClcBroadcast( INTM_RELOADOPTIONS,0,0); Sync(CLUIFrames_OnClistResize_mod,0,0); ske_RedrawCompleteWindow(); Sync(CLUIFrames_OnClistResize_mod, (WPARAM)0, (LPARAM)0); { HWND hwnd=pcli->hwndContactList; RECT rc={0}; GetWindowRect(hwnd, &rc); Sync(CLUIFrames_OnMoving,hwnd,&rc); } return TRUE; } else return TRUE; } break; } } return FALSE; }
void SetAppropriateGroups(HWND hwndDlg, int Type) //str contains default values { switch (Type) { case -1: { EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_GROUP_1),FALSE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_ST_COLOUR),FALSE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_ST_ALPHA),FALSE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_GROUP_2),FALSE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_GROUP_3),FALSE); ShowWindow(GetDlgItem(hwndDlg,IDC_S_SIZE),FALSE); } break; case 0: { EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_GROUP_1),TRUE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_ST_COLOUR),FALSE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_ST_ALPHA),FALSE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_GROUP_2),FALSE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_GROUP_3),FALSE); ShowWindow(GetDlgItem(hwndDlg,IDC_S_SIZE),FALSE); } break; case 1: { EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_GROUP_1),TRUE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_ST_COLOUR),TRUE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_ST_ALPHA),TRUE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_GROUP_2),FALSE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_GROUP_3),FALSE); ShowWindow(GetDlgItem(hwndDlg,IDC_S_SIZE),FALSE); //Set Color and alpha } break; case 2: { EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_GROUP_1),TRUE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_ST_COLOUR),FALSE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_ST_ALPHA),TRUE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_GROUP_2),TRUE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_GROUP_3),FALSE); ShowWindow(GetDlgItem(hwndDlg,IDC_S_SIZE),TRUE); //Set alpha, image, margins etc. } break; case 3: { EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_GROUP_1),TRUE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_ST_COLOUR),FALSE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_ST_ALPHA),TRUE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_GROUP_2),TRUE); EnableGroup(hwndDlg,GetDlgItem(hwndDlg,IDC_GROUP_3),TRUE); ShowWindow(GetDlgItem(hwndDlg,IDC_S_SIZE),TRUE); //Set alpha, image, margins etc. } break; } }
BOOL CSetProxyPage::OnInitDialog() { ISettingsPropPage::OnInitDialog(); m_tooltips.Create(this); m_tooltips.AddTool(IDC_SERVERADDRESS, IDS_SETTINGS_PROXYSERVER_TT); CString proxy = g_Git.GetConfigValue(_T("http.proxy"), CP_UTF8); m_SSHClient = m_regSSHClient; if (m_SSHClient.IsEmpty()) m_SSHClient = CRegString(_T("Software\\TortoiseGit\\SSH"), _T(""), FALSE, HKEY_LOCAL_MACHINE); if (m_SSHClient.IsEmpty()) { TCHAR sPlink[MAX_PATH]; GetModuleFileName(NULL, sPlink, _countof(sPlink)); LPTSTR ptr = _tcsrchr(sPlink, _T('\\')); if (ptr) { _tcscpy_s(ptr + 1, MAX_PATH - (ptr - sPlink + 1), _T("TortoiseGitPLink.exe")); m_SSHClient = CString(sPlink); } } m_serveraddress = m_regServeraddress; m_serverport = _ttoi((LPCTSTR)(CString)m_regServerport); m_username = m_regUsername; m_password = m_regPassword; if (proxy.IsEmpty()) { m_isEnabled = FALSE; EnableGroup(FALSE); } else { int start=0; start = proxy.Find(_T("://"),start); if(start<0) start =0; else start+=3; int at = proxy.Find(_T("@"), 0); int port; if(at<0) { m_username=_T(""); m_password=_T(""); port=proxy.Find(_T(":"),start); if(port<0) m_serveraddress = proxy.Mid(start); else m_serveraddress = proxy.Mid(start, port-start); } else { int username; username = proxy.Find(_T(":"),start); if(username<=0 || username >at) { StringUnescape(proxy.Mid(start, at - start), &m_username); m_password=_T(""); } else if(username < at) { StringUnescape(proxy.Mid(start, username - start), &m_username); StringUnescape(proxy.Mid(username + 1, at - username - 1), &m_password); } port=proxy.Find(_T(":"),at); if(port<0) m_serveraddress = proxy.Mid(at+1); else m_serveraddress = proxy.Mid(at+1, port-at-1); } if(port<0) { m_serverport= 0; } else m_serverport = _ttoi(proxy.Mid(port+1)); m_isEnabled = TRUE; EnableGroup(TRUE); } SHAutoComplete(::GetDlgItem(m_hWnd, IDC_SSHCLIENT), SHACF_FILESYSTEM | SHACF_FILESYS_ONLY); UpdateData(FALSE); return TRUE; }
BOOL CSetProxyPage::OnInitDialog() { ISettingsPropPage::OnInitDialog(); m_tooltips.Create(this); m_tooltips.AddTool(IDC_SERVERADDRESS, IDS_SETTINGS_PROXYSERVER_TT); CString proxy = g_Git.GetConfigValue(_T("http.proxy"), CP_UTF8); m_SSHClient = m_regSSHClient; m_serveraddress = m_regServeraddress; m_serverport = _ttoi((LPCTSTR)(CString)m_regServerport); m_username = m_regUsername; m_password = m_regPassword; if (proxy.IsEmpty()) { m_isEnabled = FALSE; EnableGroup(FALSE); } else { int start=0; start = proxy.Find(_T("://"),start); if(start<0) start =0; else start+=3; int at = proxy.Find(_T("@"), 0); int port; if(at<0) { m_username=_T(""); m_password=_T(""); port=proxy.Find(_T(":"),start); if(port<0) m_serveraddress = proxy.Mid(start); else m_serveraddress = proxy.Mid(start, port-start); } else { int username; username = proxy.Find(_T(":"),start); if(username<=0 || username >at) { StringUnescape(proxy.Mid(start, at - start), &m_username); m_password=_T(""); } else if(username < at) { StringUnescape(proxy.Mid(start, username - start), &m_username); StringUnescape(proxy.Mid(username + 1, at - username - 1), &m_password); } port=proxy.Find(_T(":"),at); if(port<0) m_serveraddress = proxy.Mid(at+1); else m_serveraddress = proxy.Mid(at+1, port-at-1); } if(port<0) { m_serverport= 0; } else m_serverport = _ttoi(proxy.Mid(port+1)); m_isEnabled = TRUE; EnableGroup(TRUE); } SHAutoComplete(::GetDlgItem(m_hWnd, IDC_SSHCLIENT), SHACF_FILESYSTEM | SHACF_FILESYS_ONLY); UpdateData(FALSE); return TRUE; }
//--------------------------------------------------------------------------------------- void GrpHarmony::synchronize_with_selection(bool fEnable, SelectionSet* pSelection) { //TODO EnableGroup(fEnable); }
//--------------------------------------------------------------------------------------- void GrpHarmony::synchronize_with_cursor(bool fEnable, DocCursor* pCursor) { //TODO EnableGroup(fEnable); }