本文整理汇总了C++中FrmGetActiveForm函数的典型用法代码示例。如果您正苦于以下问题:C++ FrmGetActiveForm函数的具体用法?C++ FrmGetActiveForm怎么用?C++ FrmGetActiveForm使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了FrmGetActiveForm函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: AppHandleEvent
static Boolean AppHandleEvent(EventPtr eventP) {
Boolean handled = false;
FormType *frmP;
if (eventP->eType == frmLoadEvent) { /* Initialize and activate the form resource. */
frmP = FrmInitForm(eventP->data.frmLoad.formID);
FrmSetActiveForm(frmP);
if (eventP->data.frmLoad.formID == MainForm) {
dynInputOnMainFormLoad(frmP);
FrmSetEventHandler(frmP, MainFormHandleEvent);
}
handled = true;
} else if (eventP->eType == frmOpenEvent) { /* Load the form resource. */
frmP = FrmGetActiveForm();
FrmDrawForm(frmP);
handled = true;
} else if (eventP->eType == appStopEvent) { /* Unload the form resource. */
frmP = FrmGetActiveForm();
FrmEraseForm(frmP);
FrmDeleteForm(frmP);
handled = true;
}
return(handled);
}
示例2: ThumbnailDetailViewUpdateDisplay
/***********************************************************************
*
* FUNCTION: ThumbnailDetailViewUpdateDisplay
*
* DESCRIPTION: This routine update the display of the thumbnail details view
*
* PARAMETERS: updateCode - a code that indicated what changes have been
* made to the view.
*
* RETURNED: Whether the event was handled, or not.
*
***********************************************************************/
static Boolean ThumbnailDetailViewUpdateDisplay(UInt16 updateCode) {
FormType* frm = FrmGetActiveForm();
Boolean handled = false;
switch (updateCode) {
case fUpdateDisplayOptsChanged:
SetTopVisibleRecord(0);
/* Fall through */
case fUpdateFontChanged:
ThumbnailDetailViewLoadRecords(frm);
handled = true;
break;
case fUpdateDeletedCurrent:
p.dbI = noRecordSelected;
/* fall through */
case fUpdateDeletedAny:
SetTopVisibleRecord(0);
ThumbnailDetailViewLoadRecords(frm);
handled = true;
break;
case fUpdateReloadRecords:
ThumbnailDetailViewLoadRecords(frm);
handled = true;
break;
}
/* Have a valid selected record (for 5-way navigation) */
p.dbI = d.top_visible_record;
return handled;
}
示例3: UpdateNoteProperties
/* Get current selected note and fill out note properties elements.
If selected == -1, clear and disable this fields. */
static void
UpdateNoteProperties()
{
FormPtr frm = FrmGetActiveForm ();
if (notelist.selected == -1) {
FrmHideObject(frm, FrmGetObjectIndex(frm, ID_EditorDuration));
FrmHideObject(frm, FrmGetObjectIndex(frm, ID_EditorVelocity));
FrmHideObject(frm, FrmGetObjectIndex(frm, ID_EditorPause));
}
else {
NotePtr notes = MemHandleLock(notelist.bufH);
NotePtr note = notes + notelist.selected;
ErrFatalDisplayIf(notelist.selected > notelist.num, "Invalid note index!");
SetFieldTextFromNumber(ID_EditorDuration, note->dur);
SetFieldTextFromNumber(ID_EditorVelocity, note->vel);
SetFieldTextFromNumber(ID_EditorPause, note->pause);
FrmShowObject(frm, FrmGetObjectIndex(frm, ID_EditorDuration));
FrmShowObject(frm, FrmGetObjectIndex(frm, ID_EditorVelocity));
FrmShowObject(frm, FrmGetObjectIndex(frm, ID_EditorPause));
MemPtrUnlock(notes);
}
}
示例4: 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;
}
示例5: NewGameGetPlayerName
static void NewGameGetPlayerName( UInt16 field, Int16 player)
{
FormPtr frm = FrmGetActiveForm();
Char *buff;
if( tmppref[player].type == PlayerNone )
{
return;
}
buff = FldGetTextPtr(
FrmGetObjectPtr(
frm,
FrmGetObjectIndex(
frm,
fldNGname0+player )
)
);
if( tmppref[player].type == PlayerHuman )
{
StrCopy( tmppref[player].hname, buff );
}
if( tmppref[player].type == PlayerAI )
{
StrCopy( tmppref[player].aname, buff );
}
}
示例6: 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;
}
示例7: DrawTable
void DrawTable(DmOpenRef db, Int16 category)
{
FormPtr form = FrmGetActiveForm();
if (FormIsNot(form, FormMain)) return;
TablePtr table = (TablePtr) GetObjectPtr(form, SMSTable);
if (table == NULL) return;
if (category >= 0) g_SelectedCategory = category;
for (int c = 0; c < TABLE_NUM_COLUMNS; ++c) {
TblSetCustomDrawProcedure(table, c, PrivDrawCell);
TblSetColumnUsable(table, c, true);
TblSetColumnWidth(table, c, COLUMN_WIDTHS[c]);
}
for (int r = 0; r < TABLE_PAGE_SIZE; ++r) {
UInt32 cursor = g_CurrentPage * TABLE_PAGE_SIZE + r;
if (cursor >= GetSMSCount(db, g_SelectedCategory)) {
TblSetRowUsable(table, r, false);
} else {
TblSetRowSelectable(table, r, true);
TblSetRowUsable(table, r, true);
for(int c = 0; c < TABLE_NUM_COLUMNS; c++ )
TblSetItemStyle(table, r, c, customTableItem);
}
}
TblDrawTable(table);
UpdateScrollbar(db);
UpdateUnread(db);
UpdatePos(db);
}
示例8: 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 );
}
示例9: FormGroupManagementHandleEvent
Boolean FormGroupManagementHandleEvent(EventType* eventP)
{
Boolean handled = false;
switch (eventP->eType)
{
case frmOpenEvent:
FormPtr frmP = FrmGetActiveForm();
FrmDrawForm(frmP);
ListAllGroups();
handled = true;
break;
case frmCloseEvent:
ClearPhoneGroups(g_PhoneGroups);
break;
case ctlSelectEvent:
switch(eventP->data.ctlSelect.controlID) {
case ButtonOk:
FrmGotoForm(FormMain);
break;
case ButtonNew:
NewGroup();
break;
case ButtonRemove:
RemoveCurrentSelection();
break;
case ButtonModify:
EditCurrentSelection();
break;
}
break;
}
return handled;
}
示例10: DialogVariantsHandleEvent
static Boolean DialogVariantsHandleEvent (EventPtr e)
{
Boolean handled = false;
FormPtr frm;
CALLBACK_PROLOGUE
switch (e->eType) {
case frmOpenEvent:
frm = FrmGetActiveForm();
FrmDrawForm(frm);
handled = true;
break;
case ctlSelectEvent:
if( stor.currplayer >= 0 ) {
/* The player *cannot* continue a
game once they alter variants */
ResetCubes();
}
switch(e->data.ctlSelect.controlID) {
case check_Bump:
ToggleCheck( check_Bump, flag_Bump );
if( (stor.flags & flag_Eclipse) &&
(stor.flags & flag_Bump ) ) {
ToggleCheck( check_Eclipse, flag_Eclipse );
}
break;
case check_Eclipse:
ToggleCheck( check_Eclipse, flag_Eclipse );
if( (stor.flags & flag_Eclipse) &&
(stor.flags & flag_Bump ) ) {
ToggleCheck( check_Bump, flag_Bump );
}
break;
case check_Sampler:
ToggleCheck( check_Sampler, flag_Sampler );
break;
case check_nTW:
ToggleCheck( check_nTW, flag_nTW );
break;
case check_FullHouse:
ToggleCheck(check_FullHouse, flag_FullHouse );
break;
case check_Suspend:
ToggleCheck(check_Suspend, flag_Suspend );
break;
}
break;
default:
break;
}
CALLBACK_EPILOGUE
return handled;
}
示例11: 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;
}
示例12: ResidentBrowseFormHandleEvent
static Boolean ResidentBrowseFormHandleEvent(EventType* event)
{
Boolean handled=false;
FormType* form=FrmGetActiveForm();
AppContext* appContext=GetAppContext();
Assert(appContext);
switch (event->eType)
{
case winEnterEvent:
handled=ResidentBrowseFormWinEnter(appContext, form, event);
break;
case winDisplayChangedEvent:
handled=ResidentBrowseFormDisplayChanged(appContext, form);
break;
case lstSelectEvent:
handled=ResidentBrowseFormListItemSelected(appContext, form, event);
break;
case ctlSelectEvent:
handled=ResidentBrowseFormControlSelected(appContext, form, event);
break;
case fldChangedEvent:
handled=ResidentBrowseFormFieldChanged(appContext, form, event);
break;
case keyDownEvent:
handled=ResidentBrowseFormKeyDown(appContext, form, event);
break;
}
return handled;
}
示例13: SelectTo
static void SelectTo()
{
FormPtr frmP = FrmGetActiveForm();
if (FormIsNot(frmP, FormReply)) return;
SendPref pref;
ReadSendPreference(pref);
if (pref.useFingerAddress) {
if (FasSearchAvailable()) {
SelectUsingFingerAddr();
return;
}
}
FieldPtr fieldTo = (FieldPtr) GetObjectPtr(frmP, FieldTo);
FldSetSelection(fieldTo, 0, StrLen(FldGetTextPtr(fieldTo)));
AddrLookupParamsType params;
MemSet(¶ms, sizeof(AddrLookupParamsType), 0);
params.formatStringP = "^mobile";
params.field1 = addrLookupSortField;
params.field2 = addrLookupMobile;
params.field2Optional = false;
params.userShouldInteract = true;
PhoneNumberLookupCustom (fieldTo, ¶ms, true);
FrmSetFocus(frmP, FrmGetObjectIndex(frmP, FieldCompose));
}
示例14: 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;
}
示例15: UpdateScrollbar
void UpdateScrollbar(DmOpenRef db)
{
FormPtr form = FrmGetActiveForm();
if (FormIsNot(form, FormMain)) return;
ScrollBarPtr scrollbar = (ScrollBarPtr) GetObjectPtr(form, SMSScroll);
SclSetScrollBar(scrollbar, g_CurrentPage, 0, PrivPageCount(db), 1);
}