CIntInput::CIntInput(const neutrino_locale_t Name, int *Value, const unsigned int Size, const neutrino_locale_t Hint_1, const neutrino_locale_t Hint_2, CChangeObserver* Observ) : CExtendedInput(Name, &valueStringTmp, Hint_1, Hint_2, Observ) { myValue = Value; if (Size<MAX_CINTINPUT_SIZE) m_size = Size; else m_size = MAX_CINTINPUT_SIZE-1; onBeforeExec(); frameBuffer = CFrameBuffer::getInstance(); for (unsigned int i=0;i<Size;i++) addInputField( new CExtendedInput_Item_Char("0123456789 ") ); addInputField( new CExtendedInput_Item_newLiner(30) ); }
// init //--------------------------------------------------------------------------- void PlayerNameView::init() { playerName.init(GameConfig::player_name->c_str(), INPUT_FIELD_CHARACTERS); playerName.setString(*GameConfig::player_name); cInputField* input = addInputField(iXY(BORDER_SPACE, BORDER_SPACE+2), &playerName, "", true, INPUT_FIELD_CHARACTERS); input->setTextAction(textChanged); input->setExcludedCharacters("\\"); } // end PlayerNameView::init
IRCLobbyView::IRCLobbyView() : View() { lobby_connection=0; change_name=0; skipChatLines=0; lobby_view_height=184; total_displayed_servers=0; setSearchName("IRCLobbyView"); setTitle("Lobby"); setSubTitle(""); setAllowResize(false); setAllowMove(false); setVisible(false); topViewableItem=0; moveTo(iXY(bodyTextRect.max.x-440, bodyTextRect.min.y + 170)); iXY area_size = iXY(440, lobby_view_height); resizeClientArea(area_size); int chat_y=lobby_view_height-(Surface::getFontHeight()*2); addButtonCenterText(iXY(getClientRect().getSizeX()-80, chat_y), 80, "Refresh", "", buttonRefresh); szChat.init(" ", 255,39); cInputField* input = addInputField(iXY(4, chat_y), &szChat, "", true); input->setReturnAction(chatReturnPressed); server_list_end_y=(Surface::getFontHeight()*6); chat_list_end_y=getClientRect().getSizeY()-(Surface::getFontHeight()*2); server_list_end_x=(getClientRect().getSizeX()-12); iXY size(12, 12); iXY pos(getClientRect().getSizeX() - size.x, 0); serverUpButton.setLabel("-"); serverUpButton.setBounds(iRect(pos, pos + size)); add(&serverUpButton); pos.y= server_list_end_y-size.y; serverDownButton.setLabel("+"); serverDownButton.setBounds(iRect(pos, pos + size)); add(&serverDownButton); pos.y+=size.y; chatUpButton.setLabel("-"); chatUpButton.setBounds(iRect(pos, pos + size)); add(&chatUpButton); pos.y = chat_list_end_y-size.y; chatDownButton.setLabel("+"); chatDownButton.setBounds(iRect(pos, pos + size)); add(&chatDownButton); // XXX ugly ugly ugly if(!lobby_view) lobby_view = this; }
bool InputLine::addInputField(int length, int inputMode, int defaultInputMode, bool smartInputType){ int start = findSpace(length) + 1; if(start != 0){ return addInputField(start, length, inputMode, defaultInputMode, smartInputType); } else { return false; } }
bool InputLine::addInputField(int length, int inputMode){ int start = findSpace(length) + 1; if(start != 0){ return addInputField(start, length, inputMode); } else { return false; } }
void CreaTexts() { //Step1 hwT0 = addLabel("Copy/paste script source here, or open a js/html file", 10,50,WINW3,30); hwSrcEdit = addMLEdit(ID_SRCEDIT,10, 80, WINW2, 450); hwTp0 = addLabel("", 400,50,100,30); //Step2 hwT1 = addLabel("Set options for javascript minifier:", 10,50,WINW3,30); hwM0 = addCheckBox("remove redundant spaces and tabs", 10,90,WINW3,30, TRUE); hwM1 = addCheckBox("reduce linebreaks", 10,120,WINW3,30, TRUE); hwM2 = addCheckBox("remove comments", 10,150,WINW3,30, TRUE); hwM3 = addCheckBox("some other", 10,180,WINW3,30, TRUE); BtMinfy = addButton(ID_MINFY, "Minify", 10,220,100,30); //Step3 hwT2 = addLabel("Minified result:", 10,50,WINW3,30); hwMResEdit = addMLEdit(ID_MRESEDIT,10, 80, WINW2, 450); hwTp1 = addLabel("", 400,50,100,30); //Step4 hwT3 = addLabel("Set options for javascript obfuscator:", 10,50,WINW3,30); hwO0 = addCheckBox("functions", 10,90,WINW3,30, TRUE); hwO1 = addCheckBox("variables", 10,120,WINW3,30, TRUE); hwTa = addLabel("minimal length of keywords", 56,164,WINW3,30); hwO2 = addCheckBox("also in html", 10,200,WINW3,30, FALSE); hwO3 = addCheckBox("all keywords", 10,230,WINW3,30, FALSE); hwOLen = addInputField("3", 10,160,40, FontSize+8 ); BtPrepKw = addButton(ID_PREOKW, "Prepare keywords", 10,270,180,30); //Step5 hwT4 = addLabel("Clear/edit the \"new\" generated name, then obfuscate.", 10,50,WINW3,30); hwTb = addLabel("", 400,50,WINW3,100); hwKwGrid = addGrid(ID_KWDGRID,10, 100, WINW2, 450); CreateColumn(hwKwGrid,0,"new", 50); CreateColumn(hwKwGrid,1,"keyword", 220); CreateColumn(hwKwGrid,2,"cnt", 60); CreateColumn(hwKwGrid,3,"description", 430); BtObfsc = addButton(ID_OBFSC, "Obfuscate", 600,50,140,30); //Step6 hwT5 = addLabel("Obfuscated result:", 10,50,WINW3,30); hwOResEdit = addMLEdit(ID_ORESEDIT,10, 80, WINW2, 450); hwTp2 = addLabel("", 400,50,100,30); PostMessage(hwnd, WM_NOTIFY, 0, 0); // display and hide }
void cMenu::addPropertyField( uint32_t x, uint32_t y, uint32_t width, uint32_t height, uint32_t property, uint32_t subProperty, uint32_t hue, uint32_t subProperty2 ) { VAR_TYPE t = getPropertyType( property ); int32_t props = getIntFromProps( property, subProperty, subProperty2 ); if( t==T_BOOL ) { addCheckbox( x, y, 0x00D2, 0x00D3, getPropertyFieldBool( buffer[0], buffer[1], property, subProperty, subProperty2 ), props ); } else { addInputField( x, y, width, height, props, getPropertyField( buffer[0], buffer[1], property, subProperty, subProperty2 ), hue ); } editProps.insert( make_pair( props, rc_serialCurrent-1 ) ); }
void LoadingView::setNeedPassword(bool need_password) { if ( this->need_password != need_password ) { this->need_password = need_password; if ( need_password ) { password_field = addInputField(iXY(175+88, 80), &password_str, "", true, 31); add(okButton); add(passwordLabel); } else { removeInputField(password_field); removeComponent(okButton); removeComponent(passwordLabel); password_field = 0; } } }
CTimeInput::CTimeInput(const neutrino_locale_t Name, std::string* Value, const neutrino_locale_t Hint_1, const neutrino_locale_t Hint_2, CChangeObserver* Observ, bool* Cancel) : CExtendedInput(Name, &valueStringTmp, Hint_1, Hint_2, Observ, Cancel) { valueString = Value; frameBuffer = CFrameBuffer::getInstance(); #if 0 // As nobody else seems to use this class I feel free to make some minor (and mostly backwards-compatible) // adjustments to make it suitable for movieplayer playtime selection ... --martii const char *v = valueString->c_str(); if (!isdigit(*v)) { addInputField( new CExtendedInput_Item_Char("=+-") ); addInputField( new CExtendedInput_Item_Spacer(20) ); } addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_Char("0123456789") ); v = strstr(v, ":"); if (v) { v++; addInputField( new CExtendedInput_Item_Char(":",false) ); addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_Char("0123456789") ); v = strstr(v, ":"); if (v) { addInputField( new CExtendedInput_Item_Char(":",false) ); addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_Char("0123456789") ); } } #else addInputField( new CExtendedInput_Item_Char("=+-") ); addInputField( new CExtendedInput_Item_Spacer(20) ); addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_Char(":",false) ); addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_Char(":",false) ); addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_Char("0123456789") ); #endif addInputField( new CExtendedInput_Item_newLiner(30) ); }
CMACInput::CMACInput(const neutrino_locale_t Name, std::string * Value, const neutrino_locale_t Hint_1, const neutrino_locale_t Hint_2, CChangeObserver* Observ) : CExtendedInput(Name, Value, Hint_1, Hint_2, Observ) { frameBuffer = CFrameBuffer::getInstance(); addInputField( new CExtendedInput_Item_Char("0123456789ABCDEF") ); addInputField( new CExtendedInput_Item_Char("0123456789ABCDEF") ); addInputField( new CExtendedInput_Item_Spacer(20) ); addInputField( new CExtendedInput_Item_Char("0123456789ABCDEF") ); addInputField( new CExtendedInput_Item_Char("0123456789ABCDEF") ); addInputField( new CExtendedInput_Item_Spacer(20) ); addInputField( new CExtendedInput_Item_Char("0123456789ABCDEF") ); addInputField( new CExtendedInput_Item_Char("0123456789ABCDEF") ); addInputField( new CExtendedInput_Item_Spacer(20) ); addInputField( new CExtendedInput_Item_Char("0123456789ABCDEF") ); addInputField( new CExtendedInput_Item_Char("0123456789ABCDEF") ); addInputField( new CExtendedInput_Item_Spacer(20) ); addInputField( new CExtendedInput_Item_Char("0123456789ABCDEF") ); addInputField( new CExtendedInput_Item_Char("0123456789ABCDEF") ); addInputField( new CExtendedInput_Item_Spacer(20) ); addInputField( new CExtendedInput_Item_Char("0123456789ABCDEF") ); addInputField( new CExtendedInput_Item_Char("0123456789ABCDEF") ); addInputField( new CExtendedInput_Item_newLiner(30) ); }
//-----------------------------#################################------------------------------------------------------- CDateInput::CDateInput(const neutrino_locale_t Name, time_t* Time, const neutrino_locale_t Hint_1, const neutrino_locale_t Hint_2, CChangeObserver* Observ) : CExtendedInput(Name, &valueStringTmp, Hint_1, Hint_2, Observ) { time=Time; char value[40]; struct tm *tmTime = localtime(time); snprintf(value, sizeof(value), "%02d.%02d.%04d %02d:%02d", tmTime->tm_mday, tmTime->tm_mon+1, tmTime->tm_year+1900, tmTime->tm_hour, tmTime->tm_min); *valueString = std::string(value); addInputField( new CExtendedInput_Item_Char("0123") ); addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_Char(".",false) ); addInputField( new CExtendedInput_Item_Char("01") ); addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_Char(".",false) ); addInputField( new CExtendedInput_Item_Char("2",false) ); addInputField( new CExtendedInput_Item_Char("0",false) ); addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_Spacer(20) ); addInputField( new CExtendedInput_Item_Char("012") ); addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_Char(":",false) ); addInputField( new CExtendedInput_Item_Char("012345") ); addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_newLiner(30) ); }
CIPInput::CIPInput(const neutrino_locale_t Name, std::string *Value, const neutrino_locale_t Hint_1, const neutrino_locale_t Hint_2, CChangeObserver* Observ) : CExtendedInput(Name, Value, Hint_1, Hint_2, Observ) { addInputField( new CExtendedInput_Item_Char("012") ); addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_Spacer(20) ); addInputField( new CExtendedInput_Item_Char("012") ); addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_Spacer(20) ); addInputField( new CExtendedInput_Item_Char("012") ); addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_Spacer(20) ); addInputField( new CExtendedInput_Item_Char("012") ); addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_Char("0123456789") ); addInputField( new CExtendedInput_Item_newLiner(30) ); }
// init //--------------------------------------------------------------------------- void PlayerNameView::init() { playerName.init("Player", INPUT_FIELD_CHARACTERS); addInputField(iXY(BORDER_SPACE, BORDER_SPACE), &playerName, "", true); } // end PlayerNameView::init