er.h:
#ifndef __SettingsViewController_h__#define __SettingsViewController_h__#include "CrossApp.h"USING_NS_CC;class SettingsViewController : public CAViewController,public CATextFieldDelegate{public:SettingsViewController();virtual ~SettingsViewController();void viewDidLoad();void viewDidUnload();public:CAWebView* p_webView;protected:virtual bool textFieldShouldBeginEditing(CATextField* sender);//If the sender doesn't want to detach from the IME, return true;virtual bool textFieldShouldEndEditing(CATextField* sender);//virtual void textFieldShouldReturn(CATextField* sender);virtual void keyBoardHeight(CATextField* sender, int height);//Warning!!! Warning!!! Warning!!!This method is not on the OpenGL thread.virtual bool textFieldShouldChangeCharacters(CATextField* sender,unsigned int location,unsigned int lenght,const std::string& changedText);void alertButtonCallBack(CAControl* btn,DPoint point);private:CATextField* m_textField_IP;CATextField* m_textField_Port;CATextField* m_textField_Username;CATextField* m_textField_Password;CAButton* m_SaveBtn;std::string m_strIPInput;std::string m_strPortInput;};#endif /* defined(__SettingsViewController__) */
er.cpp:
#include "SettingsViewController.h"SettingsViewController::SettingsViewController(){}SettingsViewController::~SettingsViewController(){this->getView()->removeSubview(p_webView);p_webView = NULL;}void SettingsViewController::viewDidLoad(){CAImageView* view1 = CAImageView::createWithImage(CAImage::create("image/motor_control_view.jpg"));view1->setLayout(DLayoutFill);this->getView()->addSubview(view1);CALabel* label = CALabel::create();label->setColor(ccc4(51, 204, 255, 255));label->setText( UTF8( "网络参数设置"));label->setFontSize(36);label->setTextAlignment(CATextAlignmentLeft);label->setVerticalTextAlignmet(CAVerticalTextAlignmentCenter);label->setLayout(DLayout(DHorizontalLayout_W_C(240, 0.5), DVerticalLayout_H_C(40, 0.12)));this->getView()->addSubview(label);std::string ctn;m_textField_IP = CATextField::createWithLayout(DLayout(DHorizontalLayout_L_R(100, 100),
- Velocity源码阅读
- 论文超详细精读|六千字:ICCV19-PIFu
- android基于虹软的人脸识别+测温+道闸项目实现
- 2023全新UI的AI网址导航系统源码+基于Thinkphp6框架开发的
- 六 群晖NAS教程、利用Docker安装mongoDB并进行远程访问
- 基于Thinkphp6框架全新UI的AI网址导航系统源码
- 六. 代码版本管理
- bitmap的六种压缩方式,图片压缩
- OSChina 周六乱弹 ——淘宝上买U盘 你们猜店家送的啥礼品
- Chapter1 基于python的科研论文配图绘制与配色基础