コード例 #1
0
void pawsConfigCamera::SetLabels(pawsTreeNode * subtreeRoot)
{
    pawsSeqTreeNode * rootAsSeq;
    pawsTreeNode * child;
    csString boundAction;

    rootAsSeq = dynamic_cast<pawsSeqTreeNode*> (subtreeRoot);
    if (rootAsSeq != NULL)
    {
        if (!strcmp(subtreeRoot->GetAttr("type"), "onoff"))
        {
            pawsButton* actionButton = dynamic_cast<pawsButton*> (rootAsSeq->GetSeqWidget(1));
            assert(actionButton);
            actionButton->SetState(true);
        }
        else if (!strcmp(subtreeRoot->GetAttr("type"), "real"))
        {
            pawsSpinBox* spin = dynamic_cast<pawsSpinBox*> (rootAsSeq->GetSeqWidget(1));
            spin->SetValue(0);
        }
    }

    child = subtreeRoot->GetFirstChild();
    while (child != NULL)
    {
        SetLabels(child);
        child = child->GetNextSibling();
    }
}
コード例 #2
0
ファイル: Assembler.cpp プロジェクト: olegp/tyro
bool Assembler::Assemble(const char *filename, Assembly& assembly)
{
  assembly.Clear();
  LabelVector labels;

  FILE *in = fopen(filename, "rt");
  if(in == null) return false;
 
  char buffer[256];

  int linecount = 0;
  while(fgets(buffer, sizeof(buffer), in)) {
    size_t lc = strlen(buffer) - 1;
    if(buffer[lc] == '\n') buffer[lc] = '\0';

    string line(buffer);
    if(ParseLine(line, linecount, assembly, labels) == false) {
      printf("Syntax error on line %d: \"%s\"\n", linecount + 1, buffer);
      fclose(in);
      return false;
    }
    linecount ++;
  }

  fclose(in);

  // replace label indices with code positions
  return SetLabels(assembly, labels);
}
コード例 #3
0
ファイル: vidmode.c プロジェクト: aosm/X11
/*ARGSUSED*/
static void
UpdateCallback(Widget w, XtPointer call_data, XtPointer client_data)
{
    GetModeLine(True);
    SetLabels();
    SetLabelAndModeline();
}
コード例 #4
0
ファイル: vidmode.c プロジェクト: aosm/X11
static void
RestoreCallback(Widget w, XtPointer call_data, XtPointer client_data)
{
    memcpy(&modeline, &orig_modeline, sizeof(XF86VidModeModeLine));
    if (autoflag)
	ApplyCallback(w, call_data, client_data);
    SetLabels();
}
コード例 #5
0
ファイル: csTest.cpp プロジェクト: auranet/csmap
void CcsTest::OnCststReverse() 
{
	CWnd* errorPtr;
	CString tmpSystem;
	double tmpXY [3];

	// Capture status of the check boxes before we proceed.
	if (!UpdateData (TRUE)) return;
	tmpSystem = m_SrcKeyName;
	m_SrcKeyName = m_TrgKeyName;
	m_TrgKeyName = tmpSystem;
	SetLabels (false);
	SetLabels (true);
	tmpXY [0] = m_SourceXY [0];
	tmpXY [1] = m_SourceXY [1];
	tmpXY [2] = m_SourceXY [2];
	m_SourceXY [0] = m_TargetXY [0];
	m_SourceXY [1] = m_TargetXY [1];
	m_SourceXY [2] = m_TargetXY [2];
	m_TargetXY [0] = tmpXY [0];
	m_TargetXY [1] = tmpXY [1];
	m_TargetXY [2] = tmpXY [2];
	UpdateSource ();
	FetchSource ();
	errorPtr = Calculate ();
	if (errorPtr == NULL)
	{
		UpdateTarget ();
		errorPtr = GetDlgItem (IDC_CSTST_SRCXLAT);
	}
	else
	{
		char ctemp [256];
		CS_errmsg (ctemp,sizeof (ctemp));
		AfxMessageBox (ctemp);
	}
	GotoDlgCtrl (errorPtr);
	UpdateData (FALSE);
	return;
}
コード例 #6
0
ファイル: csTest.cpp プロジェクト: auranet/csmap
BOOL CcsTest::OnInitDialog ()
{
	CWnd *wp;

	CDialog::OnInitDialog ();

	UpdateSource ();
	if (m_SrcKeyName.IsEmpty ()) m_SrcKeyName = "US48";
	if (m_TrgKeyName.IsEmpty ()) m_TrgKeyName = "LL27";
	SetLabels (true);
	SetLabels (false);
	FetchSource ();
	Calculate ();
	UpdateSource ();
	UpdateTarget ();
	UpdateData (FALSE);

	// Disable the Help button if help is not available.
	wp = GetDlgItem (ID_CSTST_HELP);
	if (wp != NULL) wp->EnableWindow (CS_isHlpAvailable ());

	return (TRUE);
};
コード例 #7
0
ファイル: vidmode.c プロジェクト: aosm/X11
static void
TestTimeout(XtPointer client_data, XtIntervalId* id)
{
    XF86VidModeModeLine mode;

    XtPopdown(testshell);
    timeout = 0;
    memcpy(&mode, &modeline, sizeof(XF86VidModeModeLine));
    memcpy(&modeline, &orig_modeline, sizeof(XF86VidModeModeLine));
    ApplyCallback((Widget)client_data, NULL, NULL);
/*    if (hitError == 0)*/
	memcpy(&modeline, &mode, sizeof(XF86VidModeModeLine));
    SetLabels();
}
コード例 #8
0
ファイル: csTest.cpp プロジェクト: auranet/csmap
void CcsTest::OnCststTrgcsbtn() 
{
	CcsBrowse csBrowse;

	if (!UpdateData (TRUE)) return;
	csBrowse.SetInitialKeyName (m_TrgKeyName);
	INT_PTR st = csBrowse.DoModal ();
	if (st == IDOK)
	{
		m_TrgKeyName = csBrowse.GetSelectedKeyName ();
		SetLabels (true);
		OnChange ();
		UpdateData (FALSE);
	}
}
コード例 #9
0
ファイル: vidmode.c プロジェクト: aosm/X11
/*ARGSUSED*/
static void
ApplyCallback(Widget w, XtPointer call_data, XtPointer client_data)
{
    hitError = 0;
    XF86VidModeModModeLine(XtDisplay(w), vidtune->screen, &modeline);
    XSync(XtDisplay(w), False);
    if (hitError) {
	if (repeater != NULL) {
	    XtCallActionProc(repeater, "unset", NULL, NULL, 0);
	    XtCallActionProc(repeater, "stop", NULL, NULL, 0);
	    repeater = NULL;
	}
	XBell(XtDisplay(w), 80);
	if (timeout)
	    StopTestCallback(w, NULL, NULL);
	GetModeLine(False);
	SetLabels();
    }
}
コード例 #10
0
void MailWindow::SetPickedMail(Containers::Mail *pickedMail)
{
    mail = pickedMail;
    SetLabels();
}
コード例 #11
0
ファイル: csTest.cpp プロジェクト: auranet/csmap
void CcsTest::OnKillfocusCststTrgkeynm() 
{
	if (!UpdateData (TRUE)) return;
	SetLabels (true);
	UpdateData (FALSE);	
}
コード例 #12
0
ファイル: csTest.cpp プロジェクト: auranet/csmap
void CcsTest::OnKillfocusCststSrckeynm() 
{
	if (!UpdateData (TRUE)) return;
	SetLabels (false);
	UpdateData (FALSE);	
}
コード例 #13
0
ファイル: vidmode.c プロジェクト: aosm/X11
void
VideoModeConfigureStart(void)
{
    vidtune = computer.vidmodes[screenno];

    XtSetSensitive(vtune, vidtune != NULL);
    if (!XtIsManaged(vtune))
	XtManageChild(vtune);
    else
	XtMapWidget(vtune);
    if (vidtune != NULL) {
	Arg args[1];
	Boolean state;
	XF86ConfMonitorPtr mon;
	static char menuName[16];
	static int menuN;

	XtErrorFunc = XSetErrorHandler(VidmodeError);
	XF86VidModeLockModeSwitch(XtDisplay(toplevel), vidtune->screen, True);
	GetModeLine(True);
	GetModes();

	SetLabels();
	XtSetArg(args[0], XtNstate, &state);
	XtGetValues(automatic, args, 1);
	XtSetSensitive(apply, !state);
	autoflag = state;

	if (monitor)
	    XtDestroyWidget(monitor);
	XmuSnprintf(menuName, sizeof(menuName), "menuP%d", menuN);
	menuN = !menuN;
	monitor = XtCreatePopupShell(menuName, simpleMenuWidgetClass,
				     vtune, NULL, 0);
	XtVaSetValues(monitorb, XtNmenuName, menuName, NULL, 0);

	mon = XF86Config->conf_monitor_lst;
	while (mon != NULL) {
	    Widget sme = XtCreateManagedWidget(mon->mon_identifier,
					       smeBSBObjectClass,
					       monitor, NULL, 0);
	    XtAddCallback(sme, XtNcallback,
			  SelectMonitorCallback, (XtPointer)mon);

	    /* guess the monitor at a given screen and/or
	     * updates configuration if a monitor was removed from the
	     * configuration.
	     */
	    if (XF86Config->conf_layout_lst) {
		XF86ConfAdjacencyPtr adj = XF86Config->conf_layout_lst->
		    lay_adjacency_lst;

		while (adj != NULL) {
		    if (adj->adj_screen != NULL) {
			if (adj->adj_screen->scrn_monitor == mon &&
			    adj->adj_scrnum >= 0 &&
			    adj->adj_scrnum < ScreenCount(XtDisplay(toplevel))) {
			    if (computer.vidmodes[adj->adj_scrnum]->monitor ==
				NULL || computer.vidmodes[adj->adj_scrnum]->
				monitor == adj->adj_screen->scrn_monitor) {
				computer.vidmodes[adj->adj_scrnum]->monitor =
				    adj->adj_screen->scrn_monitor;
				break;
			    }
			    else
				computer.vidmodes[adj->adj_scrnum]->monitor =
				    NULL;
			}
		    }
		    adj = (XF86ConfAdjacencyPtr)(adj->list.next);
		}
	    }
	    mon = (XF86ConfMonitorPtr)(mon->list.next);
	}
	SetLabelAndModeline();
    }
}