smsedit.cpp
来自「sms发送短信的程序」· C++ 代码 · 共 67 行
CPP
67 行
/* * Written By S砤womir Szczyrba <steev@hot.pl> * All rights reserved. No warrenties, use at your own risk. * This source is distributed under the GNU GENERAL PUBLIC LICENCE, * see the file "COPYING" for more information. */#include "SMSEdit.h"#include "SMSEditIco.h"FXDEFMAP(SMSEdit) SMSEditMap[]={ FXMAPFUNC(SEL_TIMEOUT, SMSEdit::ID_SMSEDIT_TIMEOUT,SMSEdit::onTimeout ), FXMAPFUNC(SEL_CHANGED, SMSEdit::ID_SMSEDIT_MSGCHANGED,SMSEdit::onChanged ), FXMAPFUNC(SEL_CHANGED, SMSEdit::ID_SMSEDIT_SIGCHANGED,SMSEdit::onChanged )};FXIMPLEMENT(SMSEdit,FXWizard,SMSEditMap,ARRAYNUMBER(SMSEditMap))SMSEdit::SMSEdit(FXApp * app):FXWizard(app,"Edycja SMSa",NULL,DECOR_TITLE|DECOR_BORDER|LAYOUT_FILL,0,0,400,300) { icon = new FXPNGIcon(app,EditMoose); setImage(icon); FXVerticalFrame* v = new FXVerticalFrame(getContainer()); frame = new FXGroupBox(v,"Znak體: 0",LAYOUT_FILL|FRAME_RIDGE,0,0,0,0, 0,0,0,0); text = new FXText(frame,this,ID_SMSEDIT_MSGCHANGED,TEXT_WORDWRAP|TEXT_NO_TABS|TEXT_AUTOINDENT|LAYOUT_TOP|LAYOUT_FILL); FXHorizontalFrame* h = new FXHorizontalFrame(v,LAYOUT_BOTTOM|LAYOUT_FILL_X); new FXLabel(h,"&Podpis: ",NULL,LABEL_NORMAL|LAYOUT_LEFT); signature = new FXTextField(h,30,this,ID_SMSEDIT_SIGCHANGED,TEXTFIELD_NORMAL|TEXTFIELD_ENTER_ONLY|LAYOUT_FILL_X); finish->setLayoutHints(LAYOUT_FILL_X); finish->setText("&Wy秎ij"); cancel->setText("&Anuluj"); retreat->setText("cofnij"); advance->setText("naprzod"); retreat->hide(); advance->hide(); retreat->disable(); advance->disable();}SMSEdit::~SMSEdit(){ delete icon;}FXuint SMSEdit::execute(FXuint placement) { FXint len; text->setFocus(); text->setText(""); len = signature->getText().length(); if (len) { len+=2;} frame->setText(FXStringFormat("Znak體: %d",len)); return FXWizard::execute(placement);}long SMSEdit::onChanged(FXObject* o,FXSelector,void*) { getApp()->addTimeout(this,ID_SMSEDIT_TIMEOUT,500); return 1;}long SMSEdit::onTimeout(FXObject*,FXSelector,void*) { FXint len = signature->getText().length(); if (len) { len+=2;} len+=text->getText().length(); frame->setText(FXStringFormat("Znak體: %d",len)); return 1;}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?