예제 #1
0
	my_form()
	{
		name.message("Your Name");
		name.limits(2,30);
		age.message("Your Age");
		age.range(0,120);
		description.message("Describe Yourself");
		p1.message("Password");
		p2.message("Confirm");
		p1.check_equal(p2);
		p1.non_empty();
		sel.message(cppcms::locale::translate("Files:"));
		sel.add("Foo");
		sel.add("Bar");
		sel.add("Bee");
		sel.add("Car");
		sel1.message(cppcms::locale::translate("Fruit"));
		sel1.add("Apple");
		sel1.add("Orange");
		sel2.message(cppcms::locale::translate("Sex"));
		sel2.add("Male");
		sel2.add("Femail");
		sel2.add("You are sexist");
		sel.at_least(2);
		sel1.non_empty();
		gif.non_empty();
		gif.add_valid_magic("GIF89a");
		gif.add_valid_magic("GIF87a");
		gif.add_valid_magic("\x89PNG\r\n\x1a\n");
		text.mime(booster::regex("text/.*"));
		*this + name + age + p1 + p2 + description + sel + sel1 + sel2 + gif + text + secret ;
	}
예제 #2
0
void Languages::fill_form_select(cppcms::widgets::select &select) {
    for( NameToCode::const_iterator itr = nameToCode.begin(); itr != nameToCode.end(); ++itr){
        //TODO l10n the language name
        select.add(
            itr->first,
            itr->second
        );
    }

}
예제 #3
0
void Languages::fill_interface_lang_select(
    cppcms::widgets::select &select
) {

    InterfaceCodeToName::const_iterator itr;
    for(
        itr = interfaceCodeToName.begin();
        itr != interfaceCodeToName.end();
        ++itr
    ) {
        select.add(
            itr->second,
            itr->first
        );
    }

}