Err DIA_FrmEnableDIA(const DIA_Settings* diaSettings, FormType* form, Coord minH, Coord prefH, Coord maxH, Coord minW, Coord prefW, Coord maxW) { Err error; WinHandle wh; Assert(diaSettings); Assert(form); if (DIA_HasSonySilkLib(diaSettings)) DIA_HandleResizeEvent(); if (!DIA_HasPenInputMgr(diaSettings)) return errNone; error=FrmSetDIAPolicyAttr(form, frmDIAPolicyCustom); if (error) goto OnError; wh=FrmGetWindowHandle(form); Assert(wh); error=PINSetInputTriggerState(pinInputTriggerEnabled); error=WinSetConstraintsSize(wh, minH, prefH, maxH, minW, prefW, maxW); error=PINSetInputAreaState(pinInputAreaUser); error = errNone; OnError: if (error==pinErrNoSoftInputArea) error=errNone; return error; }
WXWINHANDLE wxTopLevelWindowPalm::GetWinHandle() const { FormType *form = GetForm(); if(form) return FrmGetWindowHandle(form); return 0; }
static void setPalmDynInputParams(FormType *frmP) { Err err; Boolean dia=dynamicInputAvail(); if(dia) { WinHandle frmH; err=FrmSetDIAPolicyAttr(frmP,frmDIAPolicyCustom); if(!err) { err=PINSetInputTriggerState(pinInputTriggerEnabled); } frmH=FrmGetWindowHandle(frmP); WinSetConstraintsSize(frmH,160,160,640,160,160,640); } }
/* Returns whether MainForm's Window is active and OK to draw toolbars on, or not (e.g. obscured by menu, etc.) */ Boolean IsMainFormWinActive( void ) { FormType* mainForm; WinHandle mainWindow; WinHandle activeWindow; mainForm = FrmGetFormPtr( GetMainFormId() ); mainWindow = FrmGetWindowHandle( mainForm ); activeWindow = WinGetActiveWindow(); if ( mainWindow == activeWindow ) return true; else return false; }
static Boolean MainFormHandleEvent(EventPtr eventP) { Boolean handled = false; FormType *frmP; switch (eventP->eType) { case menuEvent: if (eventP->data.menu.itemID == AboutMenuItm) { MenuEraseStatus(0); FrmAlert(AboutAlert); handled = true; break; } break; case frmOpenEvent: frmP = FrmGetActiveForm(); FrmDrawForm(frmP); handled = true; break; case ctlSelectEvent: switch(eventP->data.ctlSelect.controlID) { case JavaButton: playJavaSound(); handled=true; break; default: break; } break; case keyDownEvent: if(NavSelectPressed(eventP)) { playJavaSound(); handled=true; break; } switch (eventP->data.keyDown.chr) { case vchrPageUp: case vchrJogUp: case vchrPageDown: case vchrJogDown: case vchrJogPush: case vchrJogPushedUp: case vchrJogPushedDown: playJavaSound(); handled = true; break; } break; case winDisplayChangedEvent: { RectangleType curBounds,displayBounds; frmP=FrmGetActiveForm(); WinGetBounds(FrmGetWindowHandle(frmP),&curBounds); WinGetBounds(WinGetDisplayWindow(), &displayBounds); JavaFormResizeForm(frmP,&curBounds,&displayBounds); FrmDrawForm(frmP); handled=true; break; } default: break; } return handled; }