当前位置: 首页>>代码示例>>C++>>正文


C++ FrmGetObjectIndex函数代码示例

本文整理汇总了C++中FrmGetObjectIndex函数的典型用法代码示例。如果您正苦于以下问题:C++ FrmGetObjectIndex函数的具体用法?C++ FrmGetObjectIndex怎么用?C++ FrmGetObjectIndex使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了FrmGetObjectIndex函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: SetPeople

static void SetPeople( Short num ) {
    Int x;
    Boolean found = false;
    FormPtr frm;
    ControlPtr cPtr;
    Word oIdx;

    frm = FrmGetActiveForm();

    x = MaxPlayers - 1;

    while( ( x > ( MaxPlayers - (num + 1) ) ) &&
            !found ) {
        oIdx = FrmGetObjectIndex( frm, pbtnVal[x--] );
        cPtr = FrmGetObjectPtr( frm, oIdx );

        if( CtlGetValue( cPtr ) ) {
            CtlSetValue( cPtr, false );
            found = true;
        }
    }

    if ( found ) {
        stor.tmpcomputers = MaxPlayers - (num + 1);
        oIdx = FrmGetObjectIndex( frm, cbtnVal[stor.tmpcomputers] );
        cPtr = FrmGetObjectPtr( frm, oIdx );
        CtlSetValue( cPtr, true);
    }
}
开发者ID:docwhat,项目名称:cwimp,代码行数:29,代码来源:draw.c

示例2: ResidentBrowseFormFieldChanged

static Boolean ResidentBrowseFormFieldChanged(AppContext* appContext, FormType* form, EventType* event)
{
    char *      word;
    UInt32      newSelectedWord=0;
    FieldType * field;
    ListType *  list;
    UInt16      index=FrmGetObjectIndex(form, fieldWord);

    Assert(index!=frmInvalidObjectId);
    field=(FieldType*)FrmGetObjectPtr(form, index);
    Assert(field);
    index=FrmGetObjectIndex(form, listMatching);
    Assert(index!=frmInvalidObjectId);
    list=(ListType*)FrmGetObjectPtr(form, index);
    Assert(list);
    word=FldGetTextPtr(field);
    // TODO: get length of the word via FldGetTextLength()
    if (word && *word)
        newSelectedWord = dictGetFirstMatching(GetCurrentFile(appContext), word);
    if (appContext->selectedWord != newSelectedWord)
    {
        appContext->selectedWord = newSelectedWord;
        Assert(appContext->selectedWord < appContext->wordsCount);
        LstSetSelectionMakeVisibleEx(appContext, list, appContext->selectedWord);
    }
    return true;
}
开发者ID:kjk,项目名称:noah-palm,代码行数:27,代码来源:resident_browse_form.c

示例3: SetComputers

static void SetComputers( Short num ) {
    FormPtr frm;
    ControlPtr cPtr;
    Word oIdx;

    if( num > (MaxPlayers - 1) || num < 0 ) {
        ErrNonFatalDisplayIf( true, "SetComputers: Out of Bounds");
        return;
    }

    if( stor.tmpcomputers == num ) {
        return;
    }

    frm = FrmGetActiveForm();


    /* Unset the old one */
    oIdx = FrmGetObjectIndex( frm, cbtnVal[stor.tmpcomputers] );
    cPtr = FrmGetObjectPtr( frm, oIdx );
    CtlSetValue( cPtr, false );

    /* Set new one */
    oIdx = FrmGetObjectIndex( frm, cbtnVal[num] );
    cPtr = FrmGetObjectPtr( frm, oIdx );
    CtlSetValue( cPtr, true );

    stor.tmpcomputers = num;

    if( stor.tmpcomputers + stor.tmpplayers > MaxPlayers ) {
        SetPlayers( MaxPlayers - stor.tmpcomputers );
    }

    return;
}
开发者ID:docwhat,项目名称:cwimp,代码行数:35,代码来源:draw.c

示例4: UserCredentialsFormHandleEvent

static Boolean UserCredentialsFormHandleEvent(EventType* event)
{
    switch (event->eType)
    {
        case ctlSelectEvent:
            DMSG("UserCredentialsFormHandleEvent(): ctlSelectEvent"); DENDL;
            if (okButton == event->data.ctlSelect.controlID)
            {
                FormType* form = FrmGetFormPtr(userCredentialsForm);
                UInt16 emailIndex = FrmGetObjectIndex(form, emailField);
                UInt16 passwordIndex = FrmGetObjectIndex(form, passwordField);
                const char* email = FldGetTextPtr((FieldType*)FrmGetObjectPtr(form, emailIndex));
                const char* password = FldGetTextPtr((FieldType*)FrmGetObjectPtr(form, passwordIndex));

                if (NULL == email || 0 == StrLen(email))
                {
                    FrmSetFocus(form, emailIndex);
                    return true;
                }
                if (NULL == password || 0 == StrLen(password))
                {
                    FrmSetFocus(form, passwordIndex);
                    return true;
                }
            }
            return false;

        default:
            return false;
    }
}
开发者ID:kjk,项目名称:moriarty-palm,代码行数:31,代码来源:FlickrImpl.cpp

示例5: UserCredentialsFormValidate

static void UserCredentialsFormValidate(FormType* form, FlickrPrefs& prefs)
{
    const char* email = FldGetTextPtr((FieldType*)FrmGetObjectPtr(form, FrmGetObjectIndex(form, emailField)));
    const char* password = FldGetTextPtr((FieldType*)FrmGetObjectPtr(form, FrmGetObjectIndex(form, passwordField)));
    StrCopy(prefs.email, email);
    StrCopy(prefs.password, password);
}
开发者ID:kjk,项目名称:moriarty-palm,代码行数:7,代码来源:FlickrImpl.cpp

示例6: prefs_save_checkboxes_1

static Boolean prefs_save_checkboxes_1()
{
  FormPtr frm;
  ControlPtr checkbox;
  Boolean val, dirty = false;
  frm = FrmGetActiveForm();

  checkbox = FrmGetObjectPtr(frm, FrmGetObjectIndex(frm, check_prf_4));
  my_prefs.sound = (CtlGetValue(checkbox) != 0);

  // Inverted background:
  checkbox = FrmGetObjectPtr(frm, FrmGetObjectIndex(frm, check_prf_13));
  val = (CtlGetValue(checkbox) != 0);
  if (my_prefs.black_bg != val)
    dirty = true;
  my_prefs.black_bg = val;

  // Color:
  checkbox = FrmGetObjectPtr(frm, FrmGetObjectIndex(frm, check_prf_14));
  val = (CtlGetValue(checkbox) != 0);
  if (my_prefs.color_on != val)
    dirty = true;
  my_prefs.color_on = val;
  return dirty;
}
开发者ID:BackupTheBerlios,项目名称:paleohack,代码行数:25,代码来源:form_prefs.c

示例7: DetailsFormInit

/* Initialize the details form */
static void DetailsFormInit( void )
{
    FormType*   detailsForm;
    FieldType*  urlField;
    UInt16      reference;

    detailsForm = FrmGetFormPtr( frmDetails );
    urlField    = GetObjectPtr( frmDetailsLink );
    reference   = GetHistoryCurrent();

    if ( AddURLToField( urlField, reference ) )
        FrmShowObject( detailsForm, FrmGetObjectIndex( detailsForm,
                                        frmDetailsCopy ) );
    else
        FrmHideObject( detailsForm, FrmGetObjectIndex( detailsForm,
                                        frmDetailsCopy ) );
    FrmDrawForm( detailsForm );

    AddDocNameTitle( Prefs()->docName );

    CtlSetValue( GetObjectPtr( frmDetailsStatusRead ),
        LinkVisited( reference ) );
    CtlSetValue( GetObjectPtr( frmDetailsStatusUnread ),
        ! LinkVisited( reference ) );
    CtlSetValue( GetObjectPtr( frmDetailsShowImages ),
        ShowImages( reference ) );
}
开发者ID:TimofonicJunkRoom,项目名称:plucker-1,代码行数:28,代码来源:detailsform.c

示例8: SetTimeTriggers

/***********************************************************************
 *
 * FUNCTION:    SetTimeTriggers
 *
 * DESCRIPTION: This routine sets the text label of the start time and
 *              end time triggers.
 *
 * PARAMETERS:  startTime	    - pointer to TimeType
 *              endTime        - pointer to TimeType
 *              startTimeText  - buffer that holds start time string
 *              emdTimeText    - buffer that holds end time string
 *              timeFormat     - time format
 *              untimed  	    - true if there isn't a time.
 *
 * RETURNED:	 nothing
 *
 * REVISION HISTORY:
 *			Name	Date		Description
 *			----	----		-----------
 *			art	4/4/96	Initial Revision
 *
 ***********************************************************************/
static void SetTimeTriggers (TimeType startTime, TimeType endTime,
		Char * startTimeText, Char * endTimeText, 
		TimeFormatType timeFormat, Boolean untimed)
	{

	FormType *		frm;
	ControlPtr 	startTimeCtl, endTimeCtl;

	frm = FrmGetActiveForm ();
	startTimeCtl = FrmGetObjectPtr (frm, FrmGetObjectIndex (frm, TimeSelectorStartTimeButton));
	endTimeCtl = FrmGetObjectPtr (frm, FrmGetObjectIndex (frm, TimeSelectorEndTimeButton));

	if (! untimed)
		{
		TimeToAscii (startTime.hours, startTime.minutes, timeFormat, startTimeText);
		TimeToAscii (endTime.hours, endTime.minutes, timeFormat, endTimeText);
		}
	else
		{
		// copy two spaces into these fields instead of just a null
		// because controls with empty strings (or one space) cause old-style
		// graphic control behavior, which uses the wrong colors!
		StrCopy(startTimeText, "  ");
		StrCopy(endTimeText, "  ");
		}
		
	CtlSetLabel (startTimeCtl, startTimeText);
	CtlSetLabel(endTimeCtl, endTimeText);
	}
开发者ID:kernelhcy,项目名称:hcyprojects,代码行数:51,代码来源:SelTime.c

示例9: ShowSelectWordTapIcon

/* Indicate that the next tap looks things up in the selected word */
static void ShowSelectWordTapIcon( void )
{
    FormType* mainForm;
    UInt16    prevCoordSys;

    if ( Prefs()->toolbar == TOOLBAR_NONE )
        return;

    mainForm = FrmGetFormPtr( GetMainFormId() );
    prevCoordSys = PalmSetCoordinateSystem( STANDARD );

    if ( Prefs()->toolbar == TOOLBAR_SILK ) {
        /* FIXME: figure this out */
    }
    else {
        FrmHideObject( mainForm, FrmGetObjectIndex( mainForm, bmpWait ) );

        if ( isSelectWordTapMode ) {
            FrmHideObject( mainForm, FrmGetObjectIndex( mainForm, bmpHome ) );
            FrmShowObject( mainForm, FrmGetObjectIndex( mainForm, bmpLookup ) );
        }
        else {
            FrmHideObject( mainForm, FrmGetObjectIndex( mainForm, bmpLookup ) );
            FrmShowObject( mainForm, FrmGetObjectIndex( mainForm, bmpHome ) );
        }
    }
    PalmSetCoordinateSystem( prevCoordSys );
}
开发者ID:TimofonicJunkRoom,项目名称:plucker-1,代码行数:29,代码来源:control.c

示例10: FormPenDownEvent

static Boolean
FormPenDownEvent(EventType * e)
{
  FormPtr frm = FrmGetActiveForm ();
  UInt16 objIndex;
  RectangleType r;
  Boolean res = false;

  objIndex = FrmGetObjectIndex (frm, ID_EditorMidiKeysGadget);
  FrmGetObjectBounds (frm, objIndex, &r);
  if (RctPtInRectangle (e->screenX, e->screenY, &r)) {
    midikeys_tapped(&midikeys, e->screenX, e->screenY);
    res = true;
  }

  objIndex = FrmGetObjectIndex (frm, ID_EditorNoteListGadget);
  FrmGetObjectBounds (frm, objIndex, &r);
  if (RctPtInRectangle (e->screenX, e->screenY, &r)) {
    notelist_tapped(&notelist, e->screenX, e->screenY);
    res = true;
  }

  UpdateNoteProperties();

  return res;
}
开发者ID:asashnov,项目名称:palmano,代码行数:26,代码来源:editor_form.c

示例11: FrmHideObject

/* A game of Hide and go Seek er, Show? */
static void HideNShow
    (
    UInt16 hideThis,
    UInt16 andThis,
    UInt16 butShowThis
    )
{
    FrmHideObject( form, FrmGetObjectIndex( form, hideThis ) );
    FrmHideObject( form, FrmGetObjectIndex( form, andThis ) );
    FrmShowObject( form, FrmGetObjectIndex( form, butShowThis ) );
}
开发者ID:TimofonicJunkRoom,项目名称:plucker,代码行数:12,代码来源:form.c

示例12: init_lists

static void init_lists(Short rw, Short ws)
{
  FormPtr frm;
  ListPtr lst;
  frm = FrmGetActiveForm();
  /* set initial settings for lists */
  lst = FrmGetObjectPtr(frm, FrmGetObjectIndex(frm, list_prf_1));
  LstSetSelection(lst, ws-1);
  lst = FrmGetObjectPtr(frm, FrmGetObjectIndex(frm, list_prf_2));
  LstSetSelection(lst, rw-1);
}
开发者ID:BackupTheBerlios,项目名称:paleohack,代码行数:11,代码来源:form_prefs.c

示例13: widgets

/**********************************************************************
                       UPDATE_FIELD_SCROLLERS
 IN:
 frm, fld, up_scroller, down_scroller = various UI doodads
 OUT:
 nothing
 PURPOSE:
 Update the given scroller widgets (for the given field 
 (in the given form)), according to whether the field is scrollable
 in the "up" and "down" directions.
 **********************************************************************/
void update_field_scrollers(FormPtr frm, FieldPtr fld,
			    Word up_scroller, Word down_scroller) 
{
  Boolean u, d;
  u = FldScrollable(fld, winUp);
  d = FldScrollable(fld, winDown);
  FrmUpdateScrollers(frm, 
		     FrmGetObjectIndex(frm, up_scroller),
		     FrmGetObjectIndex(frm, down_scroller),
		     u, d);
  return;
}
开发者ID:BackupTheBerlios,项目名称:paleohack,代码行数:23,代码来源:util.c

示例14: RulesSetScrolling

static void
RulesSetScrolling (void)
{
    FieldPtr	    field;

    field = FrmGetObjectPtr (rulesFrm, FrmGetObjectIndex (rulesFrm, rulesText));
    FrmUpdateScrollers (rulesFrm,
                        FrmGetObjectIndex (rulesFrm, rulesScrollUp),
                        FrmGetObjectIndex (rulesFrm, rulesScrollDown),
                        FldScrollable (field, winUp),
                        FldScrollable (field, winDown));
}
开发者ID:ricochet-robotics,项目名称:rr-palmpilot-c,代码行数:12,代码来源:main.c

示例15: init_checkboxes_1

static void init_checkboxes_1()
{
  FormPtr frm;
  ControlPtr checkbox;
  frm = FrmGetActiveForm();

  checkbox = FrmGetObjectPtr(frm, FrmGetObjectIndex(frm, check_prf_4));
  CtlSetValue(checkbox, (my_prefs.sound ? 1 : 0));
  checkbox = FrmGetObjectPtr(frm, FrmGetObjectIndex(frm, check_prf_13));
  CtlSetValue(checkbox, (my_prefs.black_bg ? 1 : 0));
  checkbox = FrmGetObjectPtr(frm, FrmGetObjectIndex(frm, check_prf_14));
  CtlSetValue(checkbox, (my_prefs.color_on ? 1 : 0));
}
开发者ID:BackupTheBerlios,项目名称:paleohack,代码行数:13,代码来源:form_prefs.c


注:本文中的FrmGetObjectIndex函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。