void ESChildComboBox::OnLButtonClick(_Point pt, UINT nFlags){ ESChildTextBox::OnLButtonClick(pt, nFlags); if( m_rcBoxButton.PtInRect(pt) ) ShowListBox(IsListBoxVisible()); else{ if( m_nComboType == (int)ComboType::ESChildComboBox_DropList ) ShowListBox(IsListBoxVisible()); } }
void ESChildComboBox::OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags){ switch( nChar ){ case VK_RETURN:{ if( m_pListBox ){ // Copy selected text from listbox into combobox.{{ if( m_pListBox->GetSelectedItem() > -1 ){ m_nSelectedItemIndex = m_pListBox->GetSelectedItem(); SendEvent(this, EventCode_ComboBoxSelChange, (void*)m_pListBox->GetItemParam(m_nSelectedItemIndex)); SetText(m_pListBox->GetItemText(m_nSelectedItemIndex), true, true); } // }} ShowListBox (true); return; } break; } case VK_ESCAPE:{ if( m_pListBox ){ ShowListBox(true); return; } break; } case VK_DOWN:{ if( m_pListBox ){ m_pListBox->SetSelectedItem(m_pListBox->GetSelectedItem() + 1, true); return; } else{ ShowListBox(); } break; } case VK_UP: { if( m_pListBox ){ m_pListBox->SetSelectedItem(m_pListBox->GetSelectedItem() - 1, true); return; } else{ ShowListBox(); } break; } }; ESChildTextBox::OnKeyDown(nChar, nRepCnt, nFlags); }
bool ESChildComboBox::Destroy(){ ShowListBox(true); if( ESChildTextBox::Destroy() ){ } return true; }
void ESChildComboBox::ClearContent(bool bRedraw){ m_content.DeleteAll(); ShowListBox(true); if( bRedraw ) Redraw(false); }
void CManualSmsListContainer::ConstructL(const TRect& aRect) { CEikStatusPane* statusPane=iEikonEnv->AppUiFactory()->StatusPane(); CAknContextPane* cp=(CAknContextPane *)statusPane->ControlL(TUid::Uid(EEikStatusPaneUidContext)); TBuf<128> iconpath; iconpath = CRippleVaultAppUi::ApplicationDriveAndPath(); iconpath.Append(KRippleImageMbmFileName); CFbsBitmap* bitmap = iEikonEnv->CreateBitmapL(iconpath, EMbmRippleimageRippleimage); CleanupStack::PushL(bitmap); CFbsBitmap* bitmapmask = iEikonEnv->CreateBitmapL(iconpath, EMbmRippleimageRippleimagem); CleanupStack::PushL(bitmapmask); cp->SetPicture(bitmap, bitmapmask); CleanupStack::Pop(); // bitmapmask CleanupStack::Pop(); // bitmap DrawNow(); CAknTitlePane* tp=(CAknTitlePane*)statusPane->ControlL(TUid::Uid(EEikStatusPaneUidTitle)); tp->SetTextL(*(iEikonEnv->AllocReadResourceL(R_EXAMPLE_RIPPLE_PUBLISH))); // Set the text string. //CEikStatusPane * statusPane = iAvkonAppUi->StatusPane(); iNaviPane = static_cast<CAknNavigationControlContainer*>(statusPane->ControlL(TUid::Uid(EEikStatusPaneUidNavi))); iNaviDeco = iNaviPane->CreateTabGroupL(); iNaviPane->PushL(static_cast<CAknNavigationDecorator &>(*iNaviDeco)); iTabGroup = static_cast<CAknTabGroup*> (iNaviDeco->DecoratedControl()); iTabGroup->AddTabL( 0, *(iEikonEnv->AllocReadResourceL(R_TAB_INBOX)) ); iTabGroup->AddTabL( 1, *(iEikonEnv->AllocReadResourceL(R_TAB_SENTITEMS)) ); if(iPhotosAppUi->iStoragePath == SMS_INBOX) iTabGroup->SetActiveTabById(0); else iTabGroup->SetActiveTabById(1); CreateListBox(); iReadSmsAO = NULL; iReadSmsAO = new (ELeave) CReadSmsAO(*this); iFlag = 1; iTempCount = 0; GetInboxSms(); GetSentItemSms(); iReadSmsAO->StartL(); SetFileList(2); ShowListBox(); }
bool CDropDown::HandleMessage(CMessage* pMessage) { bool bHandled = false; CRect SubRect(m_WindowRect); SubRect.Grow(-3); if (pMessage) { switch(pMessage->MessageType()) { case CMessage::KEYBOARD_KEYDOWN: { CKeyboardMessage* pKeyboardMessage = dynamic_cast<CKeyboardMessage*>(pMessage); if (pKeyboardMessage && pMessage->Destination() == this) { switch (pKeyboardMessage->Key) { case SDLK_UP: SelectItem(GetSelectedIndex() - 1); ShowListBox(); break; case SDLK_DOWN: SelectItem(GetSelectedIndex() + 1); ShowListBox(); break; case SDLK_RETURN: case SDLK_SPACE: HideListBox(); break; case SDLK_TAB: HideListBox(); // intentional fall through: the parent frame will change focused widget default: // Forward all key downs to parent CMessageServer::Instance().QueueMessage(new CKeyboardMessage(CMessage::KEYBOARD_KEYDOWN, m_pParentWindow, this, pKeyboardMessage->ScanCode, pKeyboardMessage->Modifiers, pKeyboardMessage->Key, pKeyboardMessage->Unicode)); break; } } break; } case CMessage::MOUSE_BUTTONDOWN: { CMouseMessage* pMouseMessage = dynamic_cast<CMouseMessage*>(pMessage); if (pMouseMessage->Button == CMouseMessage::LEFT) { if (m_pListBox->IsVisible() && m_pDropButton->GetWindowRect().SizeRect().HitTest(m_pDropButton->ViewToWindow(pMouseMessage->Point)) != CRect::RELPOS_INSIDE && m_pListBox->GetWindowRect().SizeRect().HitTest(m_pListBox->ViewToWindow(pMouseMessage->Point)) != CRect::RELPOS_INSIDE) { HideListBox(); } } break; } case CMessage::CTRL_SINGLELCLICK: { if (pMessage->Destination() == this) { if (pMessage->Source() == m_pDropButton) { if (m_pListBox->IsVisible()) { HideListBox(); } else { ShowListBox(); } bHandled = true; } } break; } case CMessage::CTRL_VALUECHANGE: { TIntMessage* pCtrlMessage = dynamic_cast<TIntMessage*>(pMessage); if (pCtrlMessage && pMessage->Destination() == this) { if (pCtrlMessage->Source() == m_pListBox) { const SListItem& ListItem = m_pListBox->GetItem(pCtrlMessage->Value()); SetWindowText(ListItem.sItemText); HideListBox(); CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_VALUECHANGE, m_pParentWindow, this, 0)); bHandled = true; } else if (pCtrlMessage->Source() == m_pEditBox) { m_pListBox->SetAllSelections(false); HideListBox(); CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_VALUECHANGE, m_pParentWindow, this, 0)); bHandled = true; } } break; } default : bHandled = CWindow::HandleMessage(pMessage); break; } } return bHandled; }
void ESChildComboBox::OnMouseWheel(UINT nFlags, short zDelta, _Point pt){ ESChildTextBox::OnMouseWheel(nFlags, zDelta, pt); if( m_pOwner->HasFocus(this) ) ShowListBox(false); }
void ESChildComboBox::KillFocus(){ // Hide list box. ShowListBox(true); ESChildTextBox::KillFocus(); }
bool CDropDown::HandleMessage(CMessage* pMessage) { bool bHandled = false; CRect SubRect(m_WindowRect); SubRect.Grow(-3); if (pMessage) { switch(pMessage->MessageType()) { case CMessage::MOUSE_BUTTONDOWN: { CMouseMessage* pMouseMessage = dynamic_cast<CMouseMessage*>(pMessage); if (pMouseMessage->Button == CMouseMessage::LEFT) { if (m_pListBox->IsVisible() && m_pDropButton->GetWindowRect().SizeRect().HitTest(m_pDropButton->ViewToWindow(pMouseMessage->Point)) != CRect::RELPOS_INSIDE && m_pListBox->GetWindowRect().SizeRect().HitTest(m_pListBox->ViewToWindow(pMouseMessage->Point)) != CRect::RELPOS_INSIDE) { HideListBox(); } } break; } case CMessage::CTRL_SINGLELCLICK: { if (pMessage->Destination() == this) { if (pMessage->Source() == m_pDropButton) { if (m_pListBox->IsVisible()) { HideListBox(); } else { ShowListBox(); } bHandled = true; } } break; } case CMessage::CTRL_VALUECHANGE: { TIntMessage* pCtrlMessage = dynamic_cast<TIntMessage*>(pMessage); if (pCtrlMessage && pMessage->Destination() == this) { if (pCtrlMessage->Source() == m_pListBox) { const SListItem& ListItem = m_pListBox->GetItem(pCtrlMessage->Value()); SetWindowText(ListItem.sItemText); HideListBox(); CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_VALUECHANGE, m_pParentWindow, this, 0)); bHandled = true; } else if (pCtrlMessage->Source() == m_pEditBox) { m_pListBox->SetAllSelections(false); HideListBox(); CMessageServer::Instance().QueueMessage(new TIntMessage(CMessage::CTRL_VALUECHANGE, m_pParentWindow, this, 0)); bHandled = true; } } break; } default : bHandled = CWindow::HandleMessage(pMessage); break; } } return bHandled; }