bool Element::IsInActiveDlg(bool fForKeyboard) { // get dlg Dialog *pDlg=GetDlg(); if (!pDlg) return false; // check if dlg is active return pDlg->IsActive(fForKeyboard); }
bool C4ChatControl::DlgEnter() { // enter on connect button connects if (GetDlg()->GetFocus() == pBtnLogin) { OnConnectBtn(pBtnLogin); return true; } return false; }
C4GUI::Edit::InputResult C4ChatControl::OnLoginDataEnter(C4GUI::Edit *edt, bool fPasting, bool fPastingMore) { // advance focus when user presses enter in one of the login edits GetDlg()->AdvanceFocus(false); // no more pasting return C4GUI::Edit::IR_Abort; }
void Label::MouseInput(CMouse &rMouse, int32_t iButton, int32_t iX, int32_t iY, DWORD dwKeyParam) { // left-click changes focus if (pClickFocusControl && iButton == C4MC_Button_LeftDown) GetDlg()->SetFocus(pClickFocusControl, true); // inherited Element::MouseInput(rMouse, iButton, iX, iY, dwKeyParam); }
void PSCustomBuildPage::OnDeleteTarget(wxCommandEvent& event) { wxUnusedVar(event); wxDataViewItem item = m_dvListCtrlTargets->GetSelection(); if(item.IsOk()) { m_dvListCtrlTargets->DeleteItem(m_dvListCtrlTargets->ItemToRow(item)); GetDlg()->SetIsDirty(true); } }
C4GUI::Control *C4ChatControl::GetDefaultControl() { // only return a default control if no control is selected to prevent // deselection of other controls if (GetDlg()->GetFocus()) return NULL; ChatSheet *pActiveSheet = GetActiveChatSheet(); if (pActiveSheet) return pActiveSheet->GetInputEdit(); if (pBtnLogin->IsVisible()) return pBtnLogin; return NULL; }
void PSCustomBuildPage::DoEditTarget(wxDataViewItem item) { CHECK_ITEM_RET(item); wxVariant varname, varcommand; m_dvListCtrlTargets->GetValue(varname, m_dvListCtrlTargets->ItemToRow(item), 0); m_dvListCtrlTargets->GetValue(varcommand, m_dvListCtrlTargets->ItemToRow(item), 1); wxString target = varname.GetString(); wxString cmd = varcommand.GetString(); ProjectCustomBuildTragetDlg dlg(this, target, cmd); if(dlg.ShowModal() == wxID_OK) { DoUpdateTarget(item, dlg.GetTargetName(), dlg.GetTargetCommand()); GetDlg()->SetIsDirty(true); } #ifdef __WXMAC__ GetDlg()->Raise(); #endif }
bool Label::OnHotkey(uint32_t cHotkey) { // if hotkey matches and focus control is assigned, set focus if (this->cHotkey == cHotkey && pClickFocusControl) { GetDlg()->SetFocus(pClickFocusControl, false); return true; } else return false; }
const CString& CDupFileFilter::GetFileMD5(const CString &filePath) { if (mFileHash.PLookup(filePath) == NULL) { CMD5 cmd5; MD5CBFn_File_data data; data.pFilter = this; data.percentage.SetCallback(Md5PercentUpdateCallback, GetDlg()); data.percentage.SetFlag(PF_UPDATE_AT_TIME_OUT); cmd5.SetMD5CBFn(MD5CBFn_File, &data); mFileHash[filePath] = cmd5.GetMD5(filePath); } return mFileHash[filePath]; }
HCBluetoothBaseDlg* KCBTDialogManager::ShowDlg(eDIALOGTYPE eDialogType) { if (eDialogType < eDIALOGT_BTDIAL || eDialogType > eDIALOGT_BTHMI/*eDIALOGT_BTCONNECTSETTING*/) { return NULL; } eDIALOGTYPE ePreType = eDIALOGT_UNKNOW; ePreType= GetCurrentDlgType(); //if(m_ePreDlgType != ePreType || m_ePreDlgType == eDIALOGT_UNKNOW) //{ m_ePreDlgType = ePreType; if(eDialogType == eDIALOGT_BTHMI) { //CreateBTHMIDlg(); m_eCurrentDlgType = eDialogType; ShowBTHMIDlg(); return NULL; } if (NULL == GetDlg(eDialogType)) { m_pBTDialog[eDialogType] = CreateBTDlg(eDialogType); } if(m_pBTDialog[eDialogType] != NULL) { HideBTHMIdlg(); m_pBTDialog[eDialogType]->RequreSource(); m_pBTDialog[eDialogType]->SetTransType(0); m_pBTDialog[eDialogType]->ClearUpdateRect(); m_pBTDialog[eDialogType]->ShowWindow(); m_pBTDialog[eDialogType]->UpdateWindow(); KCStatusIcon::GetInstance()->SetBtDialog(eDialogType +1); BTDEBUGINFO(L"SetBtDialog:eType = %d",(eDialogType +1)); } //} m_eCurrentDlgType = eDialogType; ReleaseUncurrentSource(); BTDEBUGINFO(L"%s :m_eCurrentDlgType = %d,m_ePreDlgType = %d",__FUNCTIONW__,m_eCurrentDlgType,m_ePreDlgType); return m_pBTDialog[eDialogType]; }
void PSCustomBuildPage::OnNewTarget(wxCommandEvent& event) { wxUnusedVar(event); ProjectCustomBuildTragetDlg dlg(this, "", ""); if(dlg.ShowModal() == wxID_OK) { GetDlg()->SetIsDirty(true); if(GetTargetCommand(dlg.GetName()).IsEmpty() == false) { wxMessageBox(wxString::Format(_("Target '%s' already exist!"), dlg.GetName().c_str()), _("CodeLite"), wxICON_WARNING | wxCENTER | wxOK, this); return; } wxVector<wxVariant> cols; cols.push_back(dlg.GetTargetName()); cols.push_back(dlg.GetTargetCommand()); m_dvListCtrlTargets->AppendItem(cols); } }
void Container::SetVisibility(bool fToValue) { // inherited Element::SetVisibility(fToValue); // remove focus from contained elements if (!fToValue) { Dialog *pDlg = GetDlg(); if (pDlg) { Control *pFocus = pDlg->GetFocus(); if (pFocus) { if (IsParentOf(pFocus)) { pDlg->SetFocus(NULL, false); } } } } }
void PSCustomBuildPage::OnCustomBuildCBEnabledUI(wxUpdateUIEvent& event) { GetDlg()->SetCustomBuildEnabled(m_checkEnableCustomBuild->IsChecked()); }
HCBluetoothBaseDlg* KCBTDialogManager::GetCurrentDlg() { return GetDlg(m_eCurrentDlgType); }
void PSCustomBuildPage::OnCmdEvtVModified(wxCommandEvent& event) { GetDlg()->SetIsDirty(true); }
void PSCustomBuildPage::OnCustomBuildEnabledUI(wxUpdateUIEvent& event) { event.Enable(GetDlg()->IsCustomBuildEnabled()); }
void PSCustomBuildPage::OnCustomBuildEnabled(wxCommandEvent& event) { GetDlg()->SetCustomBuildEnabled(event.IsChecked()); }
void C4ChatControl::OnConnectBtn(C4GUI::Control *btn) { // check parameters StdCopyStrBuf sNick(pEdtLoginNick->GetText()); StdCopyStrBuf sPass(pEdtLoginPass->GetText()); StdCopyStrBuf sRealName(pEdtLoginRealName->GetText()); StdCopyStrBuf sChannel(pEdtLoginChannel->GetText()); StdCopyStrBuf sServer(Config.IRC.Server); if (C4InVal::ValidateString(sNick, C4InVal::VAL_IRCName)) { GetScreen()->ShowErrorMessage(LoadResStr("IDS_ERR_INVALIDNICKNAME")); GetDlg()->SetFocus(pEdtLoginNick, false); return; } if (sPass.getLength() && C4InVal::ValidateString(sPass, C4InVal::VAL_IRCPass)) { GetScreen()->ShowErrorMessage( LoadResStr("IDS_ERR_INVALIDPASSWORDMAX31CHARA")); GetDlg()->SetFocus(pEdtLoginPass, false); return; } if (sChannel.getLength() && C4InVal::ValidateString(sChannel, C4InVal::VAL_IRCChannel)) { GetScreen()->ShowErrorMessage(LoadResStr("IDS_ERR_INVALIDCHANNELNAME")); GetDlg()->SetFocus(pEdtLoginChannel, false); return; } if (!sPass.getLength()) sPass.Clear(); if (!sChannel.getLength()) sChannel.Clear(); // store back config values SCopy(sNick.getData(), Config.IRC.Nick, CFG_MaxString); SCopy(sRealName.getData(), Config.IRC.RealName, CFG_MaxString); SCopy(sChannel.getData(), Config.IRC.Channel, CFG_MaxString); // show chat warning StdStrBuf sWarnMsg; sWarnMsg.Format(LoadResStr("IDS_MSG_YOUAREABOUTTOCONNECTTOAPU"), sServer.getData()); if (!GetScreen()->ShowMessageModal( sWarnMsg.getData(), LoadResStr("IDS_MSG_CHATDISCLAIMER"), C4GUI::MessageDialog::btnOKAbort, C4GUI::Ico_Notify, &Config.Startup.HideMsgIRCDangerous)) return; // set up IRC callback pIRCClient->SetNotify(&Application.InteractiveThread); // initiate connection if (!pIRCClient->Connect(sServer.getData(), sNick.getData(), sRealName.getData(), sPass.getData(), sChannel.getData())) { GetScreen()->ShowErrorMessage( FormatString(LoadResStr("IDS_ERR_IRCCONNECTIONFAILED"), pIRCClient->GetError()).getData()); return; } // enable client execution Application.InteractiveThread.AddProc(pIRCClient); // reset chat sheets (close queries, etc.) ClearChatSheets(); // connection message ChatSheet *pServerSheet = GetServerSheet(); if (pServerSheet) { pServerSheet->SetChatTitle(sServer.getData()); pServerSheet->AddTextLine(FormatString(LoadResStr("IDS_NET_CONNECTING"), sServer.getData(), "").getData(), C4GUI_MessageFontClr); } // switch to server window UpdateShownPage(); }