コード例 #1
0
ファイル: juce_jparam.cpp プロジェクト: olilarkin/juce_jparam
void JParam::InitBool(const String& name, bool defaultVal, const String& group, bool readonly)
{
  if (mType == kTypeNone) mType = kTypeBool;
  
  InitEnum(name, (defaultVal ? 1 : 0), 2, group, readonly);
  
  SetDisplayText(0, "off");
  SetDisplayText(1, "on");
}
コード例 #2
0
void IParam::InitBool(const char* name, bool defaultVal, const char* label, const char* group)
{
  if (mType == kTypeNone) mType = kTypeBool;
  
  InitEnum(name, (defaultVal ? 1 : 0), 2, label, group);

  SetDisplayText(0, "off");
  SetDisplayText(1, "on");
}
コード例 #3
0
ファイル: IParam.cpp プロジェクト: TaleTN/WDL
void IParam::InitBool(const char* name, bool defaultVal)
{
	if (mType == kTypeNone) {
		mType = kTypeBool;
	}
	InitEnum(name, (defaultVal ? 1 : 0), 2);

  SetDisplayText(0, "off");
  SetDisplayText(1, "on");
}
コード例 #4
0
ファイル: GsContextStateView.cpp プロジェクト: RikoudoX/Play-
void CGsContextStateView::UpdateState(CGSHandler* gs)
{
	std::string result;
	result += CGsStateUtils::GetContextState(gs, m_contextId);
	SetDisplayText(result.c_str());
	CRegViewPage::Update();
}
コード例 #5
0
ファイル: QMultiComboBox.cpp プロジェクト: qinhuaping/rtabmap
QMultiComboBox::QMultiComboBox(QWidget *widget ) :
    QComboBox(widget),
    popheight_(0),
    screenbound_(50),
    popframe_(NULL, Qt::Popup)
{

    SetDisplayText("Not Set");

    // setup the popup list
    vlist_.setSelectionMode(QAbstractItemView::MultiSelection);
    vlist_.setSelectionBehavior(QAbstractItemView::SelectItems);
    vlist_.clearSelection();
    popframe_.setLayout(new QVBoxLayout());
    popframe_.layout()->addWidget(&vlist_);
    popframe_.layout()->setContentsMargins(0,0,0,0);

    connect(&vlist_, SIGNAL(itemChanged(QListWidgetItem*)), this, SLOT(scanItemSelect(QListWidgetItem*)));

}
コード例 #6
0
ファイル: RegViewVU.cpp プロジェクト: 250394/Play-
void CRegViewVU::Update()
{
	SetDisplayText(GetDisplayText().c_str());
	CRegViewPage::Update();
}
コード例 #7
0
ファイル: textbox.cpp プロジェクト: IkarusDowned/ValyriaTear
void TextBox::SetDisplayText(const std::string &text)
{
    SetDisplayText(MakeUnicodeString(text));
}
コード例 #8
0
ファイル: Main.cpp プロジェクト: mwhooker/CalcCalc
void ProcessButtonClick(char command)
{
	//Was a Number Button Clicked?
	if (command >= '0' && command <= '9')
	{
		//Should the Display be cleared out?
		if (g_DoClear)
		{
			SetDisplayText("0");
			g_DoClear = FALSE;
		}

		//Get current text and text of number pressed
		char currentText[15]; SendMessage(
			hwndEditBox, WM_GETTEXT, 
			sizeof(currentText), (LPARAM)(void*)currentText);
		char numText[2] = { command, '\0' };


		///HACK
		if (strlen(currentText)>=6)
			return;


		//New Text is a concatenation (unless "0")
		char* newText =
			strcmp(currentText, "0") 
				? strcat(currentText, numText)
				: numText;

		//Set the new  text
		SetDisplayText(newText);
		
	}
	else if (command == 'C')
	{
		//Clear Memory, Operator, and Text
		SetDisplayText("0");
		g_Operator = '~';
		strcpy(g_Memory, "0");
	}
	else 
	{
		//Get current text 
		char currentText[15]; SendMessage(
			hwndEditBox, WM_GETTEXT, 
			sizeof(currentText), (LPARAM)(void*)currentText);

		//Get ops
		double op1 = atof(g_Memory);
		double op2 = atof(currentText);

		//get answer/Error indicator
		int isErr = 0;
		double ans = DoOperation(g_Operator, op1, op2, &isErr);

		//Display Answer
		char newText[15] = "0";
		if (isErr == 1)
		{
			SetDisplayText("Err");
		}
		else
		{
			sprintf(newText, "%g", ans);
			SetDisplayText(newText);
		}

		//Set
		g_DoClear = TRUE;
		strcpy(g_Memory, newText);
		g_Operator = command;
	}

}