예제 #1
0
파일: exams.c 프로젝트: timn/unimatrix
Boolean
ExamDetailsFormHandleEvent(EventPtr event)
{
  FormPtr frm=FrmGetActiveForm();
  Boolean handled = false;

  if (event->eType == ctlSelectEvent) {
    // button handling
    switch (event->data.ctlSelect.controlID) {
      case BUTTON_exd_cancel:
        handled=true;
        ExamDetailsFormFree();
        FrmReturnToForm(FORM_exams);
        FrmUpdateForm(FORM_exams, frmRedrawUpdateCode);
        break;

      case BUTTON_exd_ok:
        handled=true;
        if (ExamDetailsFormSave()) {
          ExamDetailsFormFree();
          FrmReturnToForm(FORM_exams);
          FrmUpdateForm(FORM_exams, frmRedrawUpdateCode);
        }
        break;

      case SELECTOR_exd_date:
        handled=true;
        ExamDetailsGetDate();
        break;

      case SELECTOR_exd_time:
        handled=true;
        EditTimeGetTime(GetObjectPtr(SELECTOR_exd_time), &gExamDetailsBegin, &gExamDetailsEnd, gExamDetailsTimeTrigger);
        break;

      default:
        break;
    }
  } else if (event->eType == menuOpenEvent) {
    return HandleMenuOpenEvent(event);
  } else if (event->eType == menuEvent) {
    // forwarding of menu events
    return HandleMenuEvent(event->data.menu.itemID);
  } else if (event->eType == frmOpenEvent) {
    // initializes and draws the form
    ExamDetailsFormInit(frm);
    FrmDrawForm (frm);
    handled = true;
  } else if (event->eType == frmUpdateEvent) {
    // redraws the form if needed
    FrmDrawForm (frm);
    handled = false;
  } else if (event->eType == frmCloseEvent) {
    // this is done if form is closed
    ExamDetailsFormFree();
  }

  return (handled);
}
예제 #2
0
/* 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 ) );
}
예제 #3
0
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);
}
예제 #4
0
파일: IntExp.c 프로젝트: ysei/palmos
static Boolean GraffitiFormHandleEvent(EventPtr event){
  Boolean handled = false;
  switch (event->eType) {
    case frmOpenEvent:
      FrmDrawForm(FrmGetActiveForm());
      handled = true;
      break;
    case keyDownEvent:
      if(event->data.keyDown.chr == sentence[offset]){
        offset++;
        if(offset == StrLen(sentence)){ FrmGotoForm(WinForm); }
      }
      handled = true;
      break;
    case nilEvent: {
      if(offset < StrLen(sentence)){
        updateSprite(&nextLetter);
        drawSprite(&nextLetter);
      }
      handled = true;
      break;
    }
    default:
      break;
  }
  return handled;
}
예제 #5
0
파일: draw.c 프로젝트: docwhat/cwimp
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;
}
예제 #6
0
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;
}
예제 #7
0
Boolean CBiddingForm::OnOpen(EventPtr pEvent, Boolean& bHandled) {

	InitDisplay();

	player_has_bid = false;

	FormPtr frmP = FrmGetActiveForm();
	FrmDrawForm(frmP);
	
	//
	// if the user exited the app from the bidding form, we will
	// restart the bidding process
	//
	GameStatus tmp = gManager->Status();
	if ( tmp == SetHandTrump || tmp == GetHandBids ) {
		gManager->Status(GetHandBids);
		gManager->NewTrick(false);
	}

	//
	// start bidding to the left of the dealer
	//
	gManager->tbl->current_bidder = 
		gManager->getNextPlayerIter(gManager->tbl->dealer);

	EventType event;
	event.eType = nilEvent;
	EvtAddEventToQueue (&event);

	bHandled = false;
	return true;
	
}
예제 #8
0
파일: main_form.c 프로젝트: kjk/noah-palm
static void MainFormDraw(AppContext* appContext, FormType* form, UInt16 updateCode=redrawAll)
{
    UInt16 statusBarStartY=appContext->screenHeight-lookupStatusBarHeight;
    switch (updateCode)
    {
        case redrawAll:
            FrmDrawForm(form);
            WinDrawLine(0, statusBarStartY-3, appContext->screenWidth, statusBarStartY-3);
            switch (appContext->mainFormContent)
            {
                case mainFormShowsAbout:
                    MainFormDisplayAbout(appContext);
                    break;
                
                case mainFormShowsMessage:
                case mainFormShowsDefinition:
                    MainFormDrawCurrentDisplayInfo(appContext);
                    break;
                    
                default:
                    Assert(false);
            }
            if (!(appContext->lookupStatusBarVisible && ConnectionInProgress(appContext))) 
                break; // fall through in case we should redraw status bar
                
        case redrawLookupStatusBar:
            MainFormDrawLookupStatus(appContext, form);
            break;
            
        default:            
            Assert(false);
    }            
}
예제 #9
0
파일: draw.c 프로젝트: docwhat/cwimp
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 );
}
예제 #10
0
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 ) );
}
예제 #11
0
파일: URLForm.c 프로젝트: openmobl/Atlas
Boolean URLFormHandleEvent(EventType *eventP)
{
    Boolean     handled = false;
    FormType    *frmP = FrmGetActiveForm();

    switch (eventP->eType) {
        case menuEvent:
            handled = URLFormDoCommand(eventP->data.menu.itemID);
            break;
        case frmOpenEvent:
            FrmDrawForm(frmP);
            URLFormInit(frmP);
            handled = true;
            break;
        case frmUpdateEvent:
            break;
        case ctlSelectEvent:
            handled = URLFormDoCommand(eventP->data.ctlSelect.controlID);
            break;
        default:
            break;
    }
    
    return handled;
}
예제 #12
0
static void 
FormUpdate()
{
  FormPtr frm = FrmGetActiveForm ();
  FrmDrawForm (frm);
  midikeys_draw(&midikeys);
  notelist_draw(&notelist);
  UpdateNoteProperties();
}
예제 #13
0
파일: toplevel.cpp 프로젝트: gitrider/wxsj2
bool wxTopLevelWindowPalm::Show(bool show)
{
    FrmDrawForm(FrameForm);

    wxPaintEvent event(m_windowId);
    event.SetEventObject(this);
    GetEventHandler()->ProcessEvent(event);

    return true;
}
예제 #14
0
파일: gmi.c 프로젝트: miellaby/v4p
Boolean GmF_EventHandler(EventPtr event)
{
    Boolean handled = false;
    CALLBACK_PROLOGUE
    __evt=event;
    GmF=FrmGetFormPtr(_GmF);
    switch(event->eType) {

        case ctlSelectEvent:
            break;
        case ctlRepeatEvent:
            break;
        case penDownEvent:
           GmF_OnPenDownXY(event->screenX,event->screenY);
            break;
        case penUpEvent:
           GmF_OnPenUpXY(event->screenX,event->screenY);
            break;
        case frmUpdateEvent:
              FrmHandleEvent(GmF,event);
               handled=true;
            break;
        case penMoveEvent:
        {
           RectangleType __bounds;
           GmF_OnPenMoveXY(event->screenX,event->screenY);
            break;
        }
        case tblSelectEvent:
            break;
        case lstSelectEvent:
            break;
        case popSelectEvent:
            break;
        case fldEnterEvent:
            break;
        case sclRepeatEvent:
            break;
        case sclExitEvent:
            break;
        case frmOpenEvent:
           FrmDrawForm(GmF);
           GmF_OnOpen(event);
           handled = true;
           break;
        case frmSaveEvent:
           break;
        case frmCloseEvent:
           break;
       default:
           break;
    }
    CALLBACK_EPILOGUE
    return handled;
}
예제 #15
0
Boolean PostListFormEventHandler(EventPtr event)
{
    static FormPtr gpForm;
    UInt16 postCount;

    switch (event->eType) {
    case frmOpenEvent: {
        postCount = 10; // If you exceed 10 you pop a warning and it gets trimmed.
        setup_database();
        FrmDrawForm(gpForm = FrmGetActiveForm());
        UpdatePostsTable(gpForm, postCount);

        return true;
    }
    case frmCloseEvent: {
        FrmEraseForm(gpForm);
        FrmDeleteForm(gpForm);
        return true;
    }
    case ctlSelectEvent: {
        switch (event->data.ctlSelect.controlID) {
        case HelpButton: {
            FrmCustomAlert(TheError,
                "Oops, looks like our connection goofed here, try again?",
                NULL, NULL);
            return true;
        }
        case PalmrMainMenuAbout: {
            FrmAlert(AboutAlert);
            return true;
        }
        }
    }
    case tblSelectEvent: {
        int row = event->data.tblSelect.row;
        int column = event->data.tblSelect.column;
        // char strRow[15];
        // char strColumn[15];
        //
        // sprintf(strRow, "%i", row);
        // sprintf(strColumn, "%i", column);

        // AlertPrintf3(
        //     "You selected:",
        //     strRow, strColumn);

        FrmGotoForm(PostViewForm);

        return true;
    }
    default: {
        return false;
    }
    }
}
예제 #16
0
static Err ModImport(UInt16 volRefNum, UInt8 engine, Boolean *armP) {
#ifndef _DEBUG_ENGINE
	char filename[256];
	UInt16 cardNo;
	LocalID dbID;
	UInt32 result;
	FileRef file;
#endif
	char msg[256];
	FormPtr ofmP, frmP;
	Err e = errNone;

	ofmP = FrmGetActiveForm();
	frmP = FrmInitForm(ImportForm);
	FrmSetActiveForm(frmP);
	FrmDrawForm(frmP);

	// In debug mode, the engine files are directly uploaded to the simulator
#ifndef _DEBUG_ENGINE
	// engine file ?
	BUILD_FILE(engines[engine].fileP, ".engine");
	CHECK_FILE("ScummVM engine file was not found !");
	IMPRT_FILE("Cannot import engine file !");

	// need more files ?
	dbID = DmFindDatabase(0, "ScummVM-Engine");	// be sure to have the correct dbID
	e = SysAppLaunch(cardNo, dbID, 0, sysAppLaunchCustomEngineGetInfo, 0, &result);
	*armP = ((result & GET_MODEARM) == GET_MODEARM);

	// common file ?
	if (!e && (result & GET_DATACOMMON)) {
		BUILD_FILE("common", ".data");
		CHECK_FILE("Common data file was not found !");
		IMPRT_FILE("Cannot import common data file !");
	}
	// data file ?
	if (!e && (result & GET_DATAENGINE)) {
		BUILD_FILE(engines[engine].fileP, ".data");
		CHECK_FILE("Engine data file was not found !");
		IMPRT_FILE("Cannot import engine data file !");
	}
#endif
	// if error, cleanup
	if (e) ModDelete();

onError:
	FrmEraseForm(frmP);
	FrmDeleteForm(frmP);
	if (e) {
		if (ofmP) FrmSetActiveForm(ofmP);
		FrmCustomAlert(FrmErrorAlert, msg, 0, 0);
	}

	return e;
}
예제 #17
0
파일: dialog.c 프로젝트: docwhat/cwimp
static Boolean DialogVariantsHandleEvent (EventPtr e)
{
    Boolean handled = false;
    FormPtr frm;

    switch (e->eType) {
    case frmOpenEvent:
        frm = FrmGetActiveForm();
        FrmDrawForm(frm);
        handled = true;
        break;

    case ctlSelectEvent:
        if( isGameOn() ) {
            /* 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( GetFlag(flag_Eclipse) &&
                    GetFlag(flag_Bump) ) {
                ToggleCheck( check_Eclipse, flag_Eclipse );
            }
            break;
        case check_Eclipse:
            ToggleCheck( check_Eclipse, flag_Eclipse );
            if( GetFlag(flag_Eclipse) &&
                    GetFlag(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_Suspend:
            ToggleCheck(check_Suspend, flag_Suspend   );
            break;

        }
        break;

    default:
        break;
    }

    return handled;
}
예제 #18
0
static Err FlickrGetUserCredentials(FlickrPrefs& prefs)
{
    Err err = errNone;
    FormType* form = NULL;
    bool formStateSaved = false;

    FormActiveStateType activeState;
    FrmSaveActiveState(&activeState);
    formStateSaved = true;

    MenuEraseStatus(NULL);
    form = FrmInitForm(userCredentialsForm);
    if (NULL == form)
    {
        DMSG("FlickrGetUserCredentials(): unable to initialize form");DENDL;
        err = exgMemError;
        goto Finish;
    }

    err = UserCredentialsFormInit(form, prefs);
    if (errNone != err)
        goto Finish;

    FrmSetActiveForm(form);
    FrmDrawForm(form);

    UInt16 button = FrmDoDialog(form);
    switch (button)
    {
        case cancelButton:
            err = exgErrUserCancel;
            goto Finish;

        case okButton:
            UserCredentialsFormValidate(form, prefs);
            break;

        default:
            assert(false);
    }

    FlickrSavePrefs(prefs);

Finish:
    if (NULL != form)
        FrmDeleteForm(form);

    if (formStateSaved)
        FrmRestoreActiveState(&activeState);

    return err;
}
예제 #19
0
Boolean CGameForm::OnOpen(EventPtr pEvent, Boolean& bHandled) {

	FrmDrawForm(FrmGetActiveForm());
	InitScreen();
	DrawLead();

	EventType event;
	event.eType = nilEvent;
	EvtAddEventToQueue (&event);

	bHandled = false;
	return true;
}
예제 #20
0
static Boolean
MainFormHandleEvent(EventPtr event)
{
    Boolean handled = false;
    int	    x, y;

    switch (event->eType) {
    case frmUpdateEvent:
        if (event->data.frmUpdate.formID == mainForm)
        {
            DIAG (("Call Redisplay\n"));
            Redisplay ();
            handled = true;
        }
        break;
    case frmOpenEvent:
        if (event->data.frmOpen.formID == mainForm)
        {
            FrmDrawForm (mainFrm);
            DamageBoard ();
        }
        break;
    case penDownEvent:
        if (PenLocation (event->screenX, event->screenY, &x, &y))
        {
            pen_down = true;
            pen_down_x = x;
            pen_down_y = y;
            handled = true;
        }
        break;
    case penUpEvent:
        if (pen_down &&
                PenLocation (event->screenX, event->screenY, &x, &y))
        {
            HandleBoardPen (pen_down_x, pen_down_y, x, y);
            handled = true;
        }
        pen_down = false;
        break;
    case keyDownEvent:
        RicochetKeyHandleEvent (event);
        break;
    case menuEvent:
        RicochetMenuHandleEvent (event);
        break;
    default:
        break;
    }
    return handled;
}
예제 #21
0
/* Initialize the bookmark form */
static void BookmarksFormInit( void )
{
    FormType* bookmarksForm;
    ListType* list;

    bookmarksForm = FrmGetFormPtr( frmBookmarks );
    deleted = false;

    list = GetObjectPtr( frmBookmarksList );
    CreateBookmarkList( list );
//    LstSetHeight( list, MAX_BOOKMARK_LIST_LEN );

    FrmDrawForm( bookmarksForm );
}
예제 #22
0
파일: IntExp.c 프로젝트: ysei/palmos
static Boolean HelpFormHandleEvent(EventPtr event){
  Boolean handled = false;
  switch (event->eType) {
    case frmOpenEvent:
      FrmDrawForm(FrmGetActiveForm());
      handled = true;
      break;
    case keyDownEvent:
      FrmGotoForm(GraffitiForm);
      handled = true;
      break;
    default:
      break;
  }
  return handled;
}
예제 #23
0
파일: IntExp.c 프로젝트: ysei/palmos
static Boolean WinFormHandleEvent(EventPtr event){
  Boolean handled = false;
  switch (event->eType) {
    case frmOpenEvent:
      FrmDrawForm(FrmGetActiveForm());
      handled = true;
      break;
    case ctlSelectEvent:
      if (event->data.ctlSelect.controlID == DoneButton){
        FrmGotoForm(HelpForm);
        handled = true;
      }
    default:
      break;
  }
  return handled;
}
예제 #24
0
static void DrawBuyEquipmentForm()
{
    FormPtr frmP = FrmGetActiveForm();
	int i;
	RectangularShortcuts( frmP, BuyEquipmentBButton );
	
	for (i=0; i<MAXWEAPONTYPE+MAXSHIELDTYPE+MAXGADGETTYPE; ++i)
	{
		RectangularButton( frmP, BuyEquipmentBuy0Button + i );
		
		if (i < MAXWEAPONTYPE)
		{
			if (BASEWEAPONPRICE( i ) <= 0)
				FrmHideObject( frmP, FrmGetObjectIndex( frmP, BuyEquipmentBuy0Button + i ) );
			else
				FrmShowObject( frmP, FrmGetObjectIndex( frmP, BuyEquipmentBuy0Button + i ) );
		}	
		else if (i < MAXWEAPONTYPE + MAXSHIELDTYPE)
		{
			if (BASESHIELDPRICE( i-MAXWEAPONTYPE ) <= 0)
				FrmHideObject( frmP, FrmGetObjectIndex( frmP, BuyEquipmentBuy0Button + i ) );
			else
				FrmShowObject( frmP, FrmGetObjectIndex( frmP, BuyEquipmentBuy0Button + i ) );
		}	
		else
		{
			if (BASEGADGETPRICE( i-MAXWEAPONTYPE-MAXSHIELDTYPE ) <= 0)
				FrmHideObject( frmP, FrmGetObjectIndex( frmP, BuyEquipmentBuy0Button + i ) );
			else
				FrmShowObject( frmP, FrmGetObjectIndex( frmP, BuyEquipmentBuy0Button + i ) );
		}
	}
	
	FrmDrawForm( frmP );
	
	for (i=0; i<MAXWEAPONTYPE; ++i)
		DrawItem( Weapontype[i].Name, 17+i*13, BASEWEAPONPRICE( i ) );

	for (i=0; i<MAXSHIELDTYPE; ++i)
		DrawItem( Shieldtype[i].Name, 17+(i+MAXWEAPONTYPE)*13, BASESHIELDPRICE( i ) );

	for (i=0; i<MAXGADGETTYPE; ++i)
		DrawItem( Gadgettype[i].Name, 17+(i+MAXWEAPONTYPE+MAXSHIELDTYPE)*13, BASEGADGETPRICE( i ) );

	DisplayTradeCredits();
}
예제 #25
0
Err FlickrShowUploadCompleted(FlickrSocketContext& context)
{
    if (NULL != context.progress)
    {
        PrgStopDialog(context.progress, false);
        context.progress = NULL;
    }
    Err err = errNone;
    FormType* form = NULL;
    bool formStateSaved = false;
    FormActiveStateType activeState;
    FrmSaveActiveState(&activeState);
    formStateSaved = true;

    MenuEraseStatus(NULL);
    form = FrmInitForm(uploadCompletedForm);
    if (NULL == form)
    {
        err = exgMemError;
        goto Finish;
    }

    FrmSetActiveForm(form);
    FrmDrawForm(form);

    FrmDoDialog(form);

    ControlType* control = (ControlType*)FrmGetObjectPtr(form, FrmGetObjectIndex(form, dontShowUploadCompletedFormCheckbox));
    if (NULL != control)
    {
        Int16 val = CtlGetValue(control);
        if (0 != val)
            err = FlickrDisableUploadCompletedForm();
    }


Finish:
    if (NULL != form)
        FrmDeleteForm(form);

    if (formStateSaved)
        FrmRestoreActiveState(&activeState);

    return err;
}
예제 #26
0
파일: bookmarks.c 프로젝트: kjk/noah-palm
static Boolean BookmarksFormDisplayChanged(AppContext* appContext, FormType* frm) 
{
    Assert( DIA_Supported(&appContext->diaSettings) );
    if ( !DIA_Supported(&appContext->diaSettings) )
        return false;

    UpdateFrmBounds(frm);

    SetListHeight(frm, listBookmarks, appContext->dispLinesCount);

    FrmSetObjectPosByID(frm, labelBkmSortBy, -1, appContext->screenHeight-14);
    FrmSetObjectPosByID(frm, popupSortBy, -1, appContext->screenHeight-14);
    FrmSetObjectPosByID(frm, listSortBy, -1, appContext->screenHeight-14);
    FrmSetObjectPosByID(frm, buttonCancel, appContext->screenWidth-40, appContext->screenHeight-14);

    FrmDrawForm(frm);
    return true;
}
예제 #27
0
static Boolean
prefsEventHandler (EventPtr event)
{
    int handled = 0;
    FormPtr form;
    ControlPtr ptr;

    switch (event->eType) {
    case frmOpenEvent:
	form = FrmGetActiveForm();
	ptr = FrmGetObjectPtr(form, FrmGetObjectIndex(form, cbid_repeats));
	CtlSetValue(ptr, repeats);
	ptr = FrmGetObjectPtr(form, FrmGetObjectIndex(form, cbid_rainbow));
	CtlSetValue(ptr, rainbow);
	ptr = FrmGetObjectPtr(form, FrmGetObjectIndex(form, cbid_extra));
	CtlSetValue(ptr, extra);
	FrmDrawForm(form);
	handled = 1;
	break;

    case ctlSelectEvent:  // a button was pressed and released
	switch (event->data.ctlSelect.controlID) {
	case cbid_repeats:
	    repeats = event->data.ctlSelect.on; handled = 1; break;
	case cbid_rainbow:
	    rainbow = event->data.ctlSelect.on; handled = 1; break;
	case cbid_extra:
	    extra = event->data.ctlSelect.on; handled = 1; break;

	case bid_ok:
	    FrmGotoForm(fid_kartrando); handled = 1; break;

	case bid_repeats_help: FrmAlert(aid_repeats_help); break;
	case bid_rainbow_help: FrmAlert(aid_rainbow_help); break;
	case bid_extra_help: FrmAlert(aid_extra_help); break;
	}
	break;

    default:
	break;
    }

    return handled;
}
예제 #28
0
파일: dialog.c 프로젝트: docwhat/cwimp
DieType DialogChooseThree( Char* fText, DieType c1, DieType c2, DieType c3 )
{

    FormPtr prevForm, frm;
    UInt16 hitButton;

    if( IsAI( GetCurrPlayer() ) ) {
        return AIChooseThree( c1, c2, c3 );
    }

    // Save previous form
    prevForm = FrmGetActiveForm();
    // Init new form
    frm = FrmInitForm( frmChooseThree );

    // Set it
    FrmSetActiveForm(frm);
    FrmDrawForm(frm);

    // Fill it...
    CtlSetLabel( GetObjectPtr(btnChooseThree1), val2name[c1] );
    CtlSetLabel( GetObjectPtr(btnChooseThree2), val2name[c2] );
    CtlSetLabel( GetObjectPtr(btnChooseThree3), val2name[c3] );
    SetFieldTextFromStr( fldChooseThree, 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 == btnChooseThree1 ) return c1;
    if( hitButton == btnChooseThree2 ) return c2;
    if( hitButton == btnChooseThree3 ) return c3;
    return c1;
}
예제 #29
0
static Boolean MainFormHandleEvent (EventPtr e)
{
    Boolean handled = false;
    FormPtr frm;
    
    CALLBACK_PROLOGUE

    switch (e->eType) {
    case frmOpenEvent:
	frm = FrmGetActiveForm();
	FrmDrawForm(frm);
	handled = true;
	break;

    case menuEvent:
	MenuEraseStatus(NULL);

	switch(e->data.menu.itemID) {
	}

    	handled = true;
	break;

    case ctlSelectEvent:
	switch(e->data.ctlSelect.controlID) {
	}
	break;

    case nilEvent: {
	UInt32 dt, t0 = TimGetTicks();
	mainloop ();
	dt = TimGetTicks() - t0;
	timeout = (TimGetTicks() - t0 > ticks) ? 0 : ticks - dt;
	}
	break;
    default:
        break;
    }

    CALLBACK_EPILOGUE

    return handled;
}
예제 #30
0
파일: dialog.c 프로젝트: docwhat/cwimp
void DialogPreferences() {
    FormPtr prevForm, frm;
    UInt16 hitButton;

    // Save previous form
    prevForm = FrmGetActiveForm();
    // Init new form
    frm = FrmInitForm( frmPreferences);

    // Set it
    FrmSetActiveForm(frm);
    FrmDrawForm(frm);

    // Set Controls
    CtlSetValue( GetObjectPtr(check_NextPlayerPopUp ),
                 GetFlag(flag_NextPlayerPopUp) );

    CtlSetValue( GetObjectPtr(check_ForceSoundOff ),
                 GetFlag(flag_NoSound) );

    // Set the handler
    // FrmSetEventHandler(frm, DialogNewGameHandleEvent);

    hitButton = FrmDoDialog(frm);

    // Get Controls
    SetFlag( flag_NextPlayerPopUp,
             CtlGetValue( GetObjectPtr(check_NextPlayerPopUp) ) );
    SetFlag( flag_NoSound,
             CtlGetValue( GetObjectPtr(check_ForceSoundOff) ) );

    // Delete the form, we're not using it
    FrmDeleteForm(frm);

    // Restore previous form.
    if (prevForm) {
        FrmSetActiveForm(prevForm);
    }

    // We don't care, as long as the dialog quits.
}