return g_pPhoneCallView;\r
}\r
\r
- UIButton* PhoneCallView ::initButton(const ButtonInitParams ¶ms)\r
+ UILabelButton* PhoneCallView ::initButton(const ButtonInitParams ¶ms)\r
{\r
- UIButton *button = new UIButton();\r
+ UILabelButton *button = new UILabelButton();\r
\r
const char *buttonNumber = params.buttonNumber;\r
int leftPos = params.leftPos;\r
int topPos = params.topPos;\r
int width = params.width;\r
int height = params.height;\r
- const char *defaultImgSrc = params.defaultImgSrc;\r
- const char *triggeredImgSrc = params.triggeredImgSrc;\r
+ const char *text = params.text;\r
\r
button->SetPosition(leftPos, topPos);\r
button->Resize(width, height);\r
button->SetViewId(buttonNumber);\r
\r
button->SetStyle(STYLE_BACKGROUND_COLOR, 0xff191919);\r
- button->SetStyle(STYLE_BORDER_COLOR, 0xff191919);\r
+ button->SetText(text);\r
+ button->SetFont(DEFAULT_VECTOR_FONT_FILENAME, 30);\r
+ button->SetTextColor(Color::White());\r
// Set additional properties\r
- button->SetImageSrc(defaultImgSrc, triggeredImgSrc);\r
- button->SetStyleForState(STYLE_BORDER_COLOR, 0xff191919, UIButton::PRESSED);\r
- button->SetStyleForState(STYLE_BORDER_WIDTH, 0, UIButton::PRESSED);\r
- button->SetStyleForState(STYLE_BORDER_COLOR, 0xff191919, UIButton::PRESSED);\r
+ //button->SetImageSrc(defaultImgSrc, triggeredImgSrc);\r
+ button->SetStyleForState(STYLE_BACKGROUND_COLOR, 0xff383838, UIButton::PRESSED);\r
// Add the callback for events\r
UIView::OnClickListener *buttonClick = static_cast<UIView::OnClickListener *>(PhoneCallPresenter::GetInstance());\r
button->SetOnClickListener(buttonClick);\r
// Add to rootView\r
container_->Add(button);\r
button->SetVisible(true);\r
-\r
return button;\r
+ }\r
+ void PhoneCallView ::initButtonImage()\r
+ {\r
+ UIButton *button_call = new UIButton();\r
+ UIButton *button_del = new UIButton();\r
+\r
+ button_call->SetPosition(69, 338);\r
+ button_call->Resize(104, 70);\r
+ button_call->SetViewId(BUTTONCALL);\r
+ button_del->SetPosition(293, 338);\r
+ button_del->Resize(104, 70);\r
+ button_del->SetViewId(BUTTONDEL);\r
+\r
+ button_call->SetImageSrc(buttonCallPath,buttonCallPath);\r
+ button_del->SetImageSrc(buttonDelPath,buttonDelPath);\r
+ button_call->SetStyle(STYLE_BORDER_COLOR, 0xff191919);\r
+ button_del->SetStyle(STYLE_BORDER_COLOR, 0xff191919);\r
+ // Add the callback for events\r
+ UIView::OnClickListener *buttonClick = static_cast<UIView::OnClickListener *>(PhoneCallPresenter::GetInstance());\r
+ button_call->SetOnClickListener(buttonClick);\r
+ button_del->SetOnClickListener(buttonClick);\r
+ UIView::OnLongPressListener*buttonlongpress=static_cast<UIView::OnLongPressListener *>(PhoneCallPresenter::GetInstance());\r
+ button_call->SetOnLongPressListener(buttonlongpress);\r
+ button_del->SetOnLongPressListener(buttonlongpress);\r
+\r
+ // Add to rootView\r
+ container_->Add(button_call);\r
+ button_call->SetVisible(true);\r
+ container_->Add(button_del);\r
+ button_del->SetVisible(true);\r
\r
}\r
\r
container_->Add(label_);\r
label_->SetVisible(true);\r
ButtonInitParams buttonParams[] = {\r
- { BUTTON1, 68, 104, 104, 70, button1Path, button1Path},\r
- {BUTTON2, 181, 104, 104, 70, button2Path, button2Path},\r
- { BUTTON3, 293, 104, 104, 70, button3Path, button3Path},\r
- { BUTTON4, 69, 182, 104, 70, button4Path, button4Path},\r
- { BUTTON5, 182, 182, 104, 70, button5Path, button5Path},\r
- { BUTTON6, 293, 182, 104, 70, button6Path, button6Path},\r
- { BUTTON7, 69, 260, 104, 70, button7Path, button7Path},\r
- { BUTTON8, 181, 260, 104, 70, button8Path, button8Path},\r
- { BUTTON9, 293, 260, 104, 70, button9Path, button9Path},\r
- { BUTTON0, 181, 338, 104, 70, button0Path, button0Path},\r
- { BUTTONCALL, 69, 338, 104, 70, buttonCallPath, buttonCallPath},\r
- { BUTTONDEL, 293, 338, 104, 70, buttonDelPath, buttonDelPath},\r
+ { BUTTON1, 68, 104, 104, 70, "1"},\r
+ { BUTTON2, 181, 104, 104, 70, "2"},\r
+ { BUTTON3, 293, 104, 104, 70, "3"},\r
+ { BUTTON4, 69, 182, 104, 70, "4"},\r
+ { BUTTON5, 182, 182, 104, 70, "5"},\r
+ { BUTTON6, 293, 182, 104, 70, "6"},\r
+ { BUTTON7, 69, 260, 104, 70, "7 *"},\r
+ { BUTTON8, 181, 260, 104, 70, "8"},\r
+ { BUTTON9, 293, 260, 104, 70, "9 #"},\r
+ { BUTTON0, 181, 338, 104, 70, "0 +"},\r
};\r
\r
for(int i = 0;i<12;i++){\r
button_[i] = initButton(buttonParams[i]);\r
}\r
+ initButtonImage();\r
+\r
}\r
static int8_t roll_falg=0;//0.1s一次变换\r
\r