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


C++ FrmGetActiveForm函数代码示例

本文整理汇总了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);
}
开发者ID:arigato-java,项目名称:javabutton-palmos,代码行数:27,代码来源:javabutton.c

示例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;
}
开发者ID:jemyzhang,项目名称:DiddleBug,代码行数:45,代码来源:thumbnails_details.c

示例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);
  }
}
开发者ID:asashnov,项目名称:palmano,代码行数:29,代码来源:editor_form.c

示例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(&notelist, e->screenX, e->screenY);
    res = true;
  }

  UpdateNoteProperties();

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

示例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 );
    }
}
开发者ID:docwhat,项目名称:cwimp,代码行数:27,代码来源:dialog.c

示例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;
}
开发者ID:docwhat,项目名称:cwimp,代码行数:35,代码来源:draw.c

示例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);
}
开发者ID:oldhu,项目名称:smstw,代码行数:33,代码来源:SMSTable.cpp

示例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 );
}
开发者ID:docwhat,项目名称:cwimp,代码行数:35,代码来源:draw.c

示例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;
}
开发者ID:oldhu,项目名称:smstw,代码行数:34,代码来源:FormGroupManagement.cpp

示例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;
}
开发者ID:docwhat,项目名称:cwimp,代码行数:60,代码来源:draw.c

示例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;
}
开发者ID:iPodLinux-Community,项目名称:iScummVM,代码行数:34,代码来源:formmusic.cpp

示例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;
}
开发者ID:kjk,项目名称:noah-palm,代码行数:35,代码来源:resident_browse_form.c

示例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(&params, sizeof(AddrLookupParamsType), 0);
	params.formatStringP = "^mobile";
	params.field1 = addrLookupSortField;
	params.field2 = addrLookupMobile;
	params.field2Optional = false;
	params.userShouldInteract = true;

	PhoneNumberLookupCustom (fieldTo, &params, true);
	FrmSetFocus(frmP, FrmGetObjectIndex(frmP, FieldCompose));
}
开发者ID:oldhu,项目名称:smstw,代码行数:29,代码来源:SMSReply.cpp

示例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;
}
开发者ID:oldhu,项目名称:smstw,代码行数:32,代码来源:SMSReply.cpp

示例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);
}
开发者ID:oldhu,项目名称:smstw,代码行数:7,代码来源:SMSTable.cpp


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