break;
}
break;
+ case LABEL_LIST_NUMBERS:
case LABEL_LIST_ALPHA:
switch (keyval) {
case 'a' ... 'k':
{
switch (m_mode) {
case LABEL_LIST_NUMBERS:
- //TODO: implement pinyin extension i number mode.
+ {
+ if ( index >= m_lookup_table.size() )
+ return FALSE;
+
+ IBusText * candidate = m_lookup_table.getCandidate(index);
+ Text text(candidate);
+ commitText(text);
+ reset();
+ return TRUE;
+ }
break;
case LABEL_LIST_COMMANDS:
{
else if ( isdigit (m_text[1]) ) {
m_mode = LABEL_LIST_NUMBERS;
std::string number = m_text.substr(1);
+ m_auxiliary_text += " ";
+ m_auxiliary_text += number;
+
//Generate Chinese number.
int num = atoi(number.c_str());
fillChineseNumber (num);
void setLabel (guint index, IBusText *text) { ibus_lookup_table_set_label (*this, index, text); }
void appendCandidate (IBusText *text) { ibus_lookup_table_append_candidate (*this, text); }
void appendLabel (IBusText *text) { ibus_lookup_table_append_label (*this, text); }
+ IBusText * getCandidate(guint index) { return ibus_lookup_table_get_candidate(*this, index); }
operator IBusLookupTable * (void) const
{