Example #1
0
void HEditBox::setContentSize(const CCSize& size) {
    CCEditBox::setContentSize(size);
    
    if (m_bCreated) {
        CCDictionary *dict = CCDictionary::create();
        CCArray *array = CCArray::create();
        dict->setObject(array, HVIEWKEY_ALL);
        array->addObject(toDictionary(HVIEWCMD_UPDATE));
        HNetManager::getInstance()->sendMessage(HVIEWCMD_UPDATE, dict);
    }
}
ReaderDict::ReaderDict(QWidget *parent): QDialog(parent, Qt::ToolTip)
{
	setupUi(this);           //!< Call function from ui_dictionary_reader.h for Reader's dictionary result displaying dialog UI design

	/*! Pressing toDictionaryButton shows the main dictionary application */
	connect(toDictionaryButton, SIGNAL(clicked()), this, SLOT(toDictionary()));
	/*! Pressing closeReaderDictButton hides the result dialog */
	connect(closeReaderDictButton, SIGNAL(clicked()), this, SLOT(closeReaderDict()));

	m_pcPopupExplanationArea = new CExplanationArea(this);

	m_pcPopupExplanationArea->setFixedSize(POPUPEXPLANATIONAREAWIDTH, POPUPEXPLANATIONAREAHEIGHT);
	m_pcPopupExplanationArea->setGeometry(QRect(POPUPEXPLANATIONAREAPOSX, POPUPEXPLANATIONAREAPOSY, POPUPEXPLANATIONAREAWIDTH, POPUPEXPLANATIONAREAHEIGHT));
	m_pcPopupExplanationArea->setStyleSheet(QString::fromUtf8("border:none;\n"
"background-color:white;"));

	//QFont explanationFont("Helvetica", EXPLANATIONAREAFONTSIZE, QFont::Normal);
	QFont explanationFont;
#ifdef DEFINEMYLOCALSETFAMILY
	explanationFont.setFamily(ALLTEXTFONT);
#endif
	explanationFont.setPointSize(POPUPEXPLANATIONAREAFONTSIZE);
	explanationFont.setWeight(QFont::Normal);

	m_pcPopupExplanationArea->setFont(explanationFont);
	m_pcPopupExplanationArea->setRectDraw(QRect(10, 0, POPUPEXPLANATIONAREAWIDTH - 20, POPUPEXPLANATIONAREAHEIGHT));

	QFont wordFont;
#ifdef DEFINEMYLOCALSETFAMILY
	wordFont.setFamily(ALLTEXTFONT);
#endif
	wordFont.setPointSize(POPUPWORDFONTSIZE);
	wordFont.setWeight(QFont::Bold);

	this->wordLabel->setFont(wordFont);

	QFont moreFont;
//#ifdef DEFINEMYLOCALSETFAMILY
//	moreFont.setFamily(ALLTEXTFONT);
//#endif
	moreFont.setPointSize(POPUPEXPLANATIONAREAFONTSIZE);
	moreFont.setWeight(QFont::Bold);

	moreFont.setUnderline(true);
	this->toDictionaryButton->setFont(moreFont);
	this->toDictionaryButton->setText(tr("more")); // International thanslations

	this->hide();
}
Example #3
0
void HEditBox::setText(const char* pText) {
    CCEditBox::setText(pText);
    if (m_strText == pText) return;
    
    
    if (m_bCreated) {
        CCDictionary *dict = CCDictionary::create();
        CCArray *array = CCArray::create();
        dict->setObject(array, HVIEWKEY_ALL);
        int command = HVIEWCMD_SETTEXT;
        array->addObject(toDictionary(command));
        
        HNetManager::getInstance()->sendMessage(command, dict);
    }
}
Example #4
0
void HEditBox::setVisible(bool visible) {
    CCEditBox::setVisible(visible);
//    if (m_bVisible == visible) return;
    
    
    if (m_bCreated) {
        CCDictionary *dict = CCDictionary::create();
        CCArray *array = CCArray::create();
        dict->setObject(array, HVIEWKEY_ALL);
        int command = visible ? HVIEWCMD_SHOW : HVIEWCMD_HIDE;
        array->addObject(toDictionary(command));
        
        HNetManager::getInstance()->sendMessage(command, dict);
    }
}
Example #5
0
void HViewPage::refresh() {
    CCDictionary *dict = toDictionary(HVIEWCMD_UPDATE);
    if (dict) {
        HNetManager::getInstance()->sendMessage(HVIEWCMD_UPDATE, dict);
    }
}
Example #6
0
void HViewPage::hide() {
    CCDictionary *dict = toDictionary(HVIEWCMD_HIDE);
    if (dict) {
        HNetManager::getInstance()->sendMessage(HVIEWCMD_HIDE, dict);
    }
}
Example #7
0
void HViewPage::show() {
    CCDictionary *dict = toDictionary(HVIEWCMD_SHOW);
    if (dict) {
        HNetManager::getInstance()->sendMessage(HVIEWCMD_SHOW, dict);
    }
}
Example #8
0
void HViewPage::remove() {
    CCDictionary *dict = toDictionary(HVIEWCMD_REMOVE);
    if (dict) {
        HNetManager::getInstance()->sendMessage(HVIEWCMD_REMOVE, dict);
    }
}
Example #9
0
void HViewPage::create() {
    CCDictionary *dict = toDictionary(HVIEWCMD_CREATE);
    if (dict) {
        HNetManager::getInstance()->sendMessage(HVIEWCMD_CREATE, dict);
    }
}
Example #10
0
		static iTJSDispatch2* getWhite(Image *image) { double x, y; image->chromaWhitePoint(  &x, &y); return toDictionary(x, y); }
Example #11
0
		static iTJSDispatch2* getRed(  Image *image) { double x, y; image->chromaRedPrimary(  &x, &y); return toDictionary(x, y); }