本文整理匯總了C++中GetObjectPtr函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetObjectPtr函數的具體用法?C++ GetObjectPtr怎麽用?C++ GetObjectPtr使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GetObjectPtr函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: LoadColorPrefs
/* Load the general section into memory */
static void LoadColorPrefs( void )
{
CtlSetValue( GetObjectPtr( frmPrefsColorStrikethrough ),
Prefs()->strikethrough );
CtlSetValue( GetObjectPtr( frmPrefsColorForceDefaultColors ),
Prefs()->forceDefaultColors );
}
示例2: SaveMessageIn
static Err SaveMessageIn(DmOpenRef db, Int16 category)
{
FormPtr form = FrmGetActiveForm();
if (FormIsNot(form, FormReply)) return frmErrNotTheForm;
FieldPtr fieldTo = (FieldPtr) GetObjectPtr(form, FieldTo);
FieldPtr fieldCompose = (FieldPtr) GetObjectPtr(form, FieldCompose);
char* pszTo = FldGetTextPtr(fieldTo);
char* pszCompose = FldGetTextPtr(fieldCompose);
if ((pszTo == NULL) || (StrLen(pszTo) == 0)) {
ShowMsg("No phone number set.");
return -1;
}
if ((pszCompose == NULL) || (StrLen(pszCompose) == 0)) {
FrmCustomAlert(AlertCustom, "Alert", "No message composed.", "");
return -1;
}
UInt8 state = 0;
if (category == CAT_OUTBOX) {
SendPref spref;
ReadSendPreference(spref);
if (spref.requestReport) RequestReport(state);
}
NewRecordInCategory(db, pszTo, pszCompose, category, state);
return errNone;
}
示例3: DrawRollButton
void DrawRollButton() {
if( stor.currplayer < 0 ) {
CtlSetLabel( GetObjectPtr(btn_Roll), StartString );
} else {
CtlSetLabel( GetObjectPtr(btn_Roll), RollString );
}
}
示例4: AudioCDTabSave
// Audio CD
static Boolean AudioCDTabSave() {
ControlType *cck3P;
FieldType *fld2P, *fld3P;
ListType *list1P, *list2P;
UInt16 firstTrack;
FormPtr frmP;
frmP = FrmGetActiveForm();
cck3P = (ControlType *)GetObjectPtr(TabAudioCDMP3Checkbox);
fld2P = (FieldType *)GetObjectPtr(TabAudioCDLengthSecsField);
fld3P = (FieldType *)GetObjectPtr(TabAudioCDFirstTrackField);
list1P = (ListType *)GetObjectPtr(TabAudioCDDriverList);
list2P = (ListType *)GetObjectPtr(TabAudioCDFormatList);
firstTrack = StrAToI(FldGetTextPtr(fld3P));
if (firstTrack < 1 || firstTrack > 999) {
TabSetActive(frmP, myTabP, 2);
FrmSetFocus(frmP, FrmGetObjectIndex(frmP, TabAudioCDFirstTrackField));
FrmCustomAlert(FrmErrorAlert, "Invalid track value (1...999)", 0, 0);
return false;
}
gameInfoP->musicInfo.sound.CD = CtlGetValue(cck3P);
gameInfoP->musicInfo.sound.drvCD = LstGetSelection(list1P);
gameInfoP->musicInfo.sound.frtCD = LstGetSelection(list2P);
gameInfoP->musicInfo.sound.defaultTrackLength = StrAToI(FldGetTextPtr(fld2P));
gameInfoP->musicInfo.sound.firstTrack = firstTrack;
return true;
}
示例5: DialogChooseTwo
Int DialogChooseTwo( CharPtr fText, CharPtr bOne, CharPtr bTwo ) {
FormPtr prevForm, frm;
Word hitButton;
// Save previous form
prevForm = FrmGetActiveForm();
// Init new form
frm = FrmInitForm( frmChooseTwo );
// Set it
FrmSetActiveForm(frm);
FrmDrawForm(frm);
// Fill it...
CtlSetLabel( GetObjectPtr(btnChooseTwo1), bOne );
CtlSetLabel( GetObjectPtr(btnChooseTwo2), bTwo );
SetFieldTextFromStr( fldChooseTwo, fText );
// Set the handler
// FrmSetEventHandler(frm, DialogNewGameHandleEvent);
hitButton = FrmDoDialog(frm);
// Delete the form, we're not using it
FrmDeleteForm(frm);
// Restore previous form.
if (prevForm) {
FrmSetActiveForm(prevForm);
}
if( hitButton == btnChooseTwo1 ) return 1;
if( hitButton == btnChooseTwo2 ) return 2;
return ( -1 );
}
示例6: 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 ) );
}
示例7: AnnotationFormInit
static void AnnotationFormInit( void )
{
FormType* annotationForm;
annotationForm = FrmGetFormPtr( frmAnnotation );
if ( ( entryP->flags & ANNOTATION_BOOKMARK ) &&
entryP->id.indexInParagraph == NEW_ANNOTATION ) {
SetFormTitle( annotationForm, strAddBookmarkTitle );
}
else {
SetFormTitle( annotationForm, strAnnotationTitle );
}
scrollBar = GetObjectPtr( frmAnnotationScrollBar );
if ( Prefs()->scrollbar == SCROLLBAR_LEFT ) {
SetObjectPosition( annotationForm, frmAnnotationField, false );
SetObjectPosition( annotationForm, frmAnnotationScrollBar, true );
}
field = GetObjectPtr( frmAnnotationField );
CtlSetUsable( GetObjectPtr( frmAnnotationDelete ),
entryP->id.indexInParagraph != NEW_ANNOTATION );
FrmDrawForm( annotationForm );
InsertText( field, data );
if ( entryP->id.indexInParagraph == NEW_ANNOTATION )
FldSetSelection( field, 0, StrLen( data ) );
else
FldSetInsertionPoint( field, 0 );
UpdateFieldScrollbar( field, scrollBar );
FrmSetFocus( annotationForm, FrmGetObjectIndex( annotationForm,
frmAnnotationField ) );
}
示例8: SetTriggerText
static void SetTriggerText(UInt16 selected)
{
FormPtr frmP = FrmGetActiveForm();
if (FormIsNot(frmP, FormReply)) return;
char* str = (char *)CtlGetLabel ((ControlPtr) GetObjectPtr (frmP, TriggerGroup));
StrNCopy(str, GetDisplayString(selected), 19);
CtlDrawControl((ControlPtr) GetObjectPtr (frmP, TriggerGroup));
}
示例9: ShowControl
static void ShowControl(Word objID, Boolean enable) {
if ( enable ) {
CtlShowControl( GetObjectPtr(objID) );
} else {
CtlHideControl( GetObjectPtr(objID) );
}
}
示例10: GadgetDrawHint
/*****************************************************************************
* Function: GadgetDrawHint
*
* Description: Draw the hintbox with the hint
*****************************************************************************/
void
GadgetDrawHint(const char *toptext, const char *bottext, UInt16 note)
{
RectangleType bounds;
UInt16 gadgetIndex;
RectangleType rect, textbox_top, textbox_bot;
FontID oldFont;
ControlType *ctl;
Char noteSymb[2] = { GADGET_NOTESYMBOL, 0 };
// Not needed any longer, the hint now has its own Gadget
// UInt16 top = GADGET_TOP + (GADGET_STRINGS_NUM-1) * GADGET_STRINGS_OFFSET + 5; // 6 - const = VALUE BELOW
if (! gForm) return;
gadgetIndex = FrmGetObjectIndex(gForm, gHintGadgetID);
FrmGetObjectBounds(gForm, gadgetIndex, &bounds);
WinEraseRectangle(&bounds, 0);
RctSetRectangle(&rect,
bounds.topLeft.x+1, // +1 for border
bounds.topLeft.y+1, // Put VALUE BELOW here.... +top+1 removed because of own Gadget
bounds.extent.x-3, bounds.extent.y - 3); // -4 for bottom border
// Erase Gadget area
WinSetForeColor(UIColorGetTableEntryIndex(UIObjectFrame));
WinDrawRectangleFrame(popupFrame, &rect);
RctSetRectangle(&textbox_top, rect.topLeft.x+2, rect.topLeft.y,
rect.extent.x-2,(Int16)((rect.extent.y-2)/2));
RctSetRectangle(&textbox_bot, textbox_top.topLeft.x, textbox_top.topLeft.y+textbox_top.extent.y+1,
textbox_top.extent.x, textbox_top.extent.y);
oldFont=FntSetFont(boldFont);
TNDrawCharsToFitWidth(toptext, &textbox_top);
FntSetFont(oldFont);
TNDrawCharsToFitWidth(bottext, &textbox_bot);
gHintNote = note;
if (note) {
// This time has a note
oldFont = FntSetFont(symbolFont);
RctSetRectangle(&rect, rect.topLeft.x+rect.extent.x-8,
rect.topLeft.y+rect.extent.y-12,
FntLineWidth(noteSymb, 1), FntLineHeight());
TNDrawCharsToFitWidth(noteSymb, &rect);
FntSetFont(oldFont);
}
ctl=GetObjectPtr(BUTTON_edit);
CtlShowControl(ctl);
ctl=GetObjectPtr(BUTTON_beam);
CtlShowControl(ctl);
}
示例11: CourseListHandleSelection
static Boolean
CourseListHandleSelection(void)
{
MemHandle m, mWebsite, mEmail, old;
CourseDBRecord c;
FieldType *fldWebsite, *fldEmail;
Char *buffer;
m = DmQueryRecord(DatabaseGetRefN(DB_MAIN), gCourseInd[LstGetSelection(GetObjectPtr(LIST_courses))]);
if (! m) return true;
UnpackCourse(&c, MemHandleLock(m));
fldWebsite = GetObjectPtr(FIELD_cl_website);
fldEmail = GetObjectPtr(FIELD_cl_email);
if (StrLen(c.website) == 0) {
mWebsite = MemHandleNew(4);
buffer=MemHandleLock(mWebsite);
MemSet(buffer, 4, 0);
StrCopy(buffer, "-?-");
} else {
mWebsite = MemHandleNew(StrLen(c.website)+1);
buffer = MemHandleLock(mWebsite);
MemSet(buffer, StrLen(c.website)+1, 0);
StrCopy(buffer, c.website);
}
MemHandleUnlock(mWebsite);
old = FldGetTextHandle(fldWebsite);
FldSetTextHandle(fldWebsite, mWebsite);
if (old != NULL) MemHandleFree(old);
FldDrawField(fldWebsite);
if (StrLen(c.teacherEmail) == 0) {
mEmail = MemHandleNew(4);
buffer = MemHandleLock(mEmail);
MemSet(buffer, 4, 0);
StrCopy(buffer, "-?-");
} else {
mEmail = MemHandleNew(StrLen(c.teacherEmail)+1);
buffer = MemHandleLock(mEmail);
MemSet(buffer, StrLen(c.teacherEmail)+1, 0);
StrCopy(buffer, c.teacherEmail);
}
MemHandleUnlock(mEmail);
old = FldGetTextHandle(fldEmail);
FldSetTextHandle(fldEmail, mEmail);
if (old != NULL) MemHandleFree(old);
FldDrawField(fldEmail);
MemHandleUnlock(m);
return false;
}
示例12: SendReply
Err SendReply(DmOpenRef db, gb2312_table& table)
{
MethodLogger log("SendReply");
FormPtr form = FrmGetActiveForm();
if (FormIsNot(form, FormReply)) return frmErrNotTheForm;
FieldPtr fieldTo = (FieldPtr) GetObjectPtr(form, FieldTo);
FieldPtr fieldCompose = (FieldPtr) GetObjectPtr(form, FieldCompose);
ListPtr list = (ListPtr) GetObjectPtr(form, ListGroups);
Int16 sel = LstGetSelection(list);
char* pszTo = FldGetTextPtr(fieldTo);
char* pszCompose = FldGetTextPtr(fieldCompose);
Err err = -1;
Boolean emptyTo = false;
if ((pszTo == NULL) || (StrLen(pszTo) == 0)) {
emptyTo = true;
}
Boolean emptyGroup = false;
if ((sel == noListSelection) || (sel == 0)) {
emptyGroup = true;
}
if (emptyTo && emptyGroup) {
ShowMsg("Please set To or Group.");
goto exit;
}
if ((pszCompose == NULL) || (StrLen(pszCompose) == 0)) {
FrmCustomAlert(AlertCustom, "Alert", "No message composed.", "");
goto exit;
}
if (emptyGroup)
SendTheSMS(db, table, pszTo, pszCompose);
else {
PhoneGroupPtr group = LoadPhoneGroupByUniqId(g_PhoneGroups[sel - 1]->GetUniqId());
UInt32 count = group->GetPhoneGroupItemCount();
for (UInt32 i = 0; i < count; ++i) {
PhoneGroupItemPtr item = group->GetPhoneGroupItem(i);
SendTheSMS(db, table, item->GetPhone(), pszCompose);
}
delete group;
}
exit:
return err;
}
示例13: switch
/* Handle the Gesture preferences */
Boolean PrefsGesturePreferenceEvent
(
ActionType action
)
{
Boolean handled;
handled = false;
switch ( action ) {
case AVAILABLE:
/* Always available */
handled = true;
break;
case SHOWFIRST:
handled = showFirst;
showFirst = false;
break;
case LOAD:
gestureSelected = GESTURES_UP;
MemMove( gestureMode, Prefs()->gestMode, sizeof( gestureMode ) );
InitializeActionList( frmPrefsGestureActionList );
CtlSetValue( GetObjectPtr( frmPrefsGestureGestures ),
Prefs()->gestures );
SetListToSelection( frmPrefsGestureActionList,
frmPrefsGestureSelectAction, gestureMode[ gestureSelected ] );
handled = true;
break;
case DISPLAY:
AffirmControlImage( gestureSelected, frmPrefsGestureUp,
bmpGestureUp );
handled = true;
break;
case SAVE:
Prefs()->gestures = CtlGetValue( GetObjectPtr(
frmPrefsGestureGestures ) );
MemMove( Prefs()->gestMode, gestureMode, sizeof( gestureMode ) );
handled = true;
break;
default:
handled = false;
break;
}
return handled;
}
示例14: VolumeTabSave
// Volume
static void VolumeTabSave() {
SliderControlType *slid1P, *slid2P, *slid3P, *slid4P, *slid5P;
slid1P = (SliderControlType *)GetObjectPtr(TabVolumePalmSliderControl);
slid2P = (SliderControlType *)GetObjectPtr(TabVolumeMusicSliderControl);
slid3P = (SliderControlType *)GetObjectPtr(TabVolumeSfxSliderControl);
slid4P = (SliderControlType *)GetObjectPtr(TabVolumeSpeechSliderControl);
slid5P = (SliderControlType *)GetObjectPtr(TabVolumeAudioCDSliderControl);
CtlGetSliderValues ((ControlType *)slid1P, 0, 0, 0, &gameInfoP->musicInfo.volume.palm);
CtlGetSliderValues ((ControlType *)slid2P, 0, 0, 0, &gameInfoP->musicInfo.volume.music);
CtlGetSliderValues ((ControlType *)slid3P, 0, 0, 0, &gameInfoP->musicInfo.volume.sfx);
CtlGetSliderValues ((ControlType *)slid4P, 0, 0, 0, &gameInfoP->musicInfo.volume.speech);
CtlGetSliderValues ((ControlType *)slid5P, 0, 0, 0, &gameInfoP->musicInfo.volume.audiocd);
}
示例15: SelectUsingFingerAddr
static void SelectUsingFingerAddr()
{
FormPtr form = FrmGetActiveForm();
if (FormIsNot(form, FormReply)) return;
UInt16 mode = g_ComposeMode;
char* pszTo = FldGetTextPtr((FieldPtr) GetObjectPtr(form, FieldTo));
char* pszCompose = FldGetTextPtr((FieldPtr) GetObjectPtr(form, FieldCompose));
char* pszReference = FldGetTextPtr((FieldPtr) GetObjectPtr(form, FieldReference));
UInt16 lenTo = 0;
if (pszTo) lenTo = StrLen(pszTo);
UInt16 lenCompose = 0;
if (pszCompose) lenCompose = StrLen(pszCompose);
UInt16 lenReference = 0;
if (pszReference) lenReference = StrLen(pszReference);
UInt16 size = sizeof(UInt16) + lenTo + 1 + lenCompose + 1 + lenReference + 1;
char* ftrBuf = NULL;
Err err = FtrPtrNew(appFileCreator, (UInt16) FEATURE_FINGER_ADDR, size, (void**) &ftrBuf);
if (err) return;
DmSet(ftrBuf, 0, size, 0);
UInt16 offset = 0;
DmWrite(ftrBuf, offset, &mode, sizeof(UInt16));
offset += sizeof(UInt16);
if (lenTo) {
DmWrite(ftrBuf, offset, pszTo, lenTo);
}
offset += lenTo + 1;
if (lenCompose) {
DmWrite(ftrBuf, offset, pszCompose, lenCompose);
}
offset += lenCompose + 1;
if (lenReference) {
DmWrite(ftrBuf, offset, pszReference, lenReference);
}
FasRequestSearch(appFileCreator);
}