本文整理汇总了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);
}
}
示例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;
}
示例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;
}
示例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;
}
}
示例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);
}
示例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;
}
示例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 ) );
}
示例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);
}
示例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 );
}
示例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(¬elist, e->screenX, e->screenY);
res = true;
}
UpdateNoteProperties();
return res;
}
示例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 ) );
}
示例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);
}
示例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;
}
示例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));
}
示例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));
}