/** * @brief contextMenuEvent handle context menu events. * @param event context menu event. */ void VToolDetail::contextMenuEvent(QGraphicsSceneContextMenuEvent *event) { QMenu menu; QAction *actionOption = menu.addAction(tr("Options")); QAction *actionRemove = menu.addAction(tr("Delete")); if (_referens > 1) { actionRemove->setEnabled(false); } else { actionRemove->setEnabled(true); } QAction *selectedAction = menu.exec(event->screenPos()); if (selectedAction == actionOption) { QGraphicsScene *scene = this->scene(); QList<QGraphicsView *> list = scene->views(); dialog = new DialogDetail(getData(), list.first()); connect(qobject_cast< VMainGraphicsScene * >(this->scene()), &VMainGraphicsScene::ChoosedObject, dialog, &DialogTool::ChoosedObject); connect(dialog, &DialogTool::DialogClosed, this, &VToolDetail::FullUpdateFromGuiOk); setDialog(); dialog->show(); } if (selectedAction == actionRemove) { DeleteTool(); } }
void AP_Win32Dialog_InsertHyperlink::runModal(XAP_Frame * pFrame) { UT_return_if_fail (pFrame && m_id == AP_DIALOG_ID_INSERTHYPERLINK); setDialog(this); createModal(pFrame, MAKEINTRESOURCE(AP_RID_DIALOG_INSERTHYPERLINK)); }
void XAP_Win32Dialog_Zoom::runModal(XAP_Frame * pFrame) { m_pFrame = pFrame; /* This dialog is non-persistent. This dialog should do the following: - Construct itself to represent the base-class zoomTypes z_200, z_100, z_75, z_PageWidth, z_WholePage, and z_Percent. The Unix one looks just like Microsoft Word 97, with the preview and all (even though it's not hooked up yet). - Set zoom type to match "m_zoomType" and value of radio button to match "m_zoomPercent". On "OK" (or during user-interaction) the dialog should: - Save the zoom type to "m_zoomType". - Save the value in the Percent spin button box to "m_zoomPercent". - Just quit, the data items will be ignored by the caller. */ // raise the dialog UT_ASSERT(m_id == XAP_DIALOG_ID_ZOOM); setDialog(this); createModal(pFrame, MAKEINTRESOURCEW(XAP_RID_DIALOG_ZOOM)); }
void Environment::xmlConfigure(xmlNode *fNode) { int fEmbeddedSkin = 0; while (fNode) { if (!strcmp((char *) fNode->name, "Menu")) { SubMenuNode *t = new SubMenuNode(); t->xmlConfigure(fNode->children); setTopMenu(t); setCurrentMenu(t); } else if (!strcmp((char *) fNode->name, "Resources")) { Resources *t = new Resources(); t->xmlConfigure(fNode->children); setResources(t); fEmbeddedSkin = 1; } else if (!strcmp((char *) fNode->name, "Elements")) { Elements *t = new Elements(); t->xmlConfigure(fNode->children); setElements(t); fEmbeddedSkin = 1; } else if (!strcmp((char *) fNode->name, "Dialog")) { Generic *t = new Generic(); t->xmlConfigure(fNode->children); setDialog(t); } else if (!strcmp((char *) fNode->name, "LogFile")) { setLogFileName((char *) fNode->children->content); } fNode = fNode->next; } if (fEmbeddedSkin) { mResources->loadResources(); mElements->associateResources(mResources); } }
void XAP_Win32Dialog_Insert_Symbol::runModal(XAP_Frame * pFrame) { UT_ASSERT(pFrame); UT_ASSERT(m_id == XAP_DIALOG_ID_INSERT_SYMBOL); setDialog(this); createModal(pFrame, MAKEINTRESOURCE(XAP_RID_DIALOG_INSERT_SYMBOL)); }
void XAP_Win32Dialog_HTMLOptions::runModal(XAP_Frame * pFrame) { UT_ASSERT(pFrame); UT_ASSERT(m_id == XAP_DIALOG_ID_HTMLOPTIONS); setDialog(this); createModal(pFrame, MAKEINTRESOURCEW(XAP_RID_DIALOG_HTMLOPTIONS)); }
void XAP_Win32Dialog_PluginManager::runModal(XAP_Frame * pFrame) { UT_return_if_fail(pFrame); UT_return_if_fail(m_id == XAP_DIALOG_ID_PLUGIN_MANAGER); setDialog(this); createModal(pFrame,MAKEINTRESOURCE(XAP_RID_DIALOG_PLUGIN_MANAGER)); }
void AP_Win32Dialog_Columns::runModal(XAP_Frame * pFrame) { UT_return_if_fail (m_id == AP_DIALOG_ID_COLUMNS); // raise the dialog setViewAndDoc(pFrame); setDialog(this); createModal(pFrame, MAKEINTRESOURCEW(AP_RID_DIALOG_COLUMNS)); }
HRESULT hospital::init() { _princess = SCENEMANAGER->getPrincessAddress(); _npc.img = IMAGEMANAGER->findImage("peopleFace"); _npc.frameX = 9, _npc.frameY = 1; _sickPer = _princess->getStatus().stress - _princess->getStatus().hp; //_sickPer = 30; if (_sickPer >= 10) _isSick = true; else _isSick = false; if (_isSick) setDialog("「어디어디,내가 진찰해보지」"); else setDialog("「여기는 병원이다. 아프면 오라구.」"); _dialogIdx = 0; _dialogType = DIALOG_ING; _type = HOSPITAL_NONE; _fin = false; for (int i = 0; i < 2; i++) { _chooseBox[i].rc = RectMake(610, 295 + i * 28, 120, 28); _chooseBox[i].isSelected = _chooseBox[i].isChoose = false; } _chooseBox[0].str = "예"; _chooseBox[1].str = "아니오"; _pStress.str = "스트레스", _pStress.data = _princess->getStatus().stress; _pStress.strRc = RectMake(510, 340, 80, 20); _pStress.dataRc = RectMake(590, 340, 30, 20); _pStress.progressBar = new progressBar; _pStress.progressBar->init(620, 340, 110, 20); _pStress.progressBar->setGauge(_pStress.data, 500); return S_OK; }
void AP_Win32Dialog_Latex::runModeless(XAP_Frame * pFrame) { UT_return_if_fail(pFrame); UT_return_if_fail(m_id == AP_DIALOG_ID_LATEX); setDialog(this); HWND hWndDialog = createModeless( pFrame, MAKEINTRESOURCEW(AP_RID_DIALOG_LATEX) ); UT_return_if_fail((hWndDialog != NULL)); ShowWindow(hWndDialog, SW_SHOW); m_pApp->rememberModelessId(m_id, this); }
void XAP_Win32Dialog_Insert_Symbol::runModeless(XAP_Frame * pFrame) { UT_ASSERT(pFrame); UT_ASSERT(m_id == XAP_DIALOG_ID_INSERT_SYMBOL); setDialog(this); HWND hWndDialog = createModeless( pFrame, MAKEINTRESOURCE(XAP_RID_DIALOG_INSERT_SYMBOL) ); UT_ASSERT((hWndDialog != NULL)); ShowWindow(hWndDialog, SW_SHOW); m_pApp->rememberModelessId(m_id, this); }
HRESULT cookStore::init(vector<item*> vItem) { _princess = SCENEMANAGER->getPrincessAddress(); setItem(vItem); _npc.img = IMAGEMANAGER->findImage("peopleFace"); _npc.frameX = 13, _npc.frameY = 0; setDialog("「어서와. 맛있는 요리를 먹고 가라고!」"); _dialogIdx = 0; _type = COOK_NONE; _dialogType = DIALOG_ING; _fin = false; for (int i = 0; i < 2; i++) { _chooseBox[i].rc = RectMake(610, 295 + i * 28, 120, 28); _chooseBox[i].isSelected = _chooseBox[i].isChoose = false; } _chooseBox[0].str = "물건을 산다"; _chooseBox[1].str = "가게를 나선다"; for (int i = 0; i < 3; i++) { _itemImg[i].img = new image; _itemImg[i].img->init("image/item/itemDialog(380x76,2x1).bmp", 380, 76, 2, 1, true, RGB(255, 0, 255)); _itemImg[i].data.rc = RectMake(20 + i * 190, 445, 190, 76); } for (int i = 0; i < 3; i++) { _vItem[i]->setXY(_itemImg[i].data.rc.left + 7, _itemImg[i].data.rc.top + 5); } _quitImg.data.rc = RectMake(600, 445, 120, 40); _quitImg.img = IMAGEMANAGER->findImage("storeQuit"); _selectItem = false; for (int i = 0; i < 3; i++) { _buyBox[i].rc = RectMake(610, 295 + i * 28, 150, 28); _buyBox[i].isSelected = _buyBox[i].isChoose = false; } _buyBox[0].str = "먹는다"; _buyBox[1].str = "그만 둔다"; _buyBox[2].str = "가게를 나선다"; return S_OK; }
ZoneMapPathDialog() { gMapPathDialog = this; setDialog(GTK_DIALOG(Builder::getBuilder()->getWidget("ZoneMapPathDialog"))); mPathMapList.init(*Builder::getBuilder(), "ZonePathMapTreeview", "Path Map List"); ZoneDiagramView *zoneDiagramView = Journal::getJournal()->getCurrentZoneDiagram(); mDiagramPathMap = &zoneDiagramView->getDiagram().getPathMap(); mPathMapList.clear(); for(auto const &item : *mDiagramPathMap) { appendGuiListItem(item.mSearchPath, item.mReplacePath); } }
void XAP_Win32Dialog_WindowMore::runModal(XAP_Frame * pFrame) { UT_ASSERT(pFrame); UT_ASSERT(m_id == XAP_DIALOG_ID_WINDOWMORE); // NOTE: this work could be done in XP code m_ndxSelFrame = m_pApp->findFrame(pFrame); UT_ASSERT(m_ndxSelFrame >= 0); // raise the dialog setDialog(this); createModal(pFrame, MAKEINTRESOURCEW(XAP_RID_DIALOG_WINDOWMORE)); }
pFileDialogResult pFileDialog::getExistingDirectory( QWidget* parent, const QString& caption, const QString& dir, bool enabledTextCodec, bool enabledOpenReadOnly, QFileDialog::Options options ) { pFileDialogResult result; pFileDialog fd( parent ); setDialog( &fd, caption, dir, QString::null, enabledTextCodec, enabledOpenReadOnly, QString::null, QFileDialog::Directory, options ); if ( fd.exec() == QDialog::Accepted ) { result[ pFileDialog::Directory ] = fd.selectedFiles().value( 0 ); result[ pFileDialog::TextCodec ] = fd.textCodec(); result[ pFileDialog::OpenReadOnly ] = fd.openReadOnly(); } return result; }
pFileDialogResult pFileDialog::getSaveFileName( QWidget* parent, const QString& caption, const QString& dir, const QString& filter, bool enabledTextCodec, const QString& selectedFilter, QFileDialog::Options options ) { pFileDialogResult result; pFileDialog fd( parent ); setDialog( &fd, caption, dir, filter, enabledTextCodec, false, selectedFilter, QFileDialog::AnyFile, options ); if ( fd.exec() == QDialog::Accepted ) { result[ pFileDialog::FileName ] = fd.selectedFiles().value( 0 ); result[ pFileDialog::TextCodec ] = fd.textCodec(); result[ pFileDialog::OpenReadOnly ] = fd.openReadOnly(); result[ pFileDialog::SelectedFilter ] = fd.selectedFilter(); } return result; }
pFileDialogResult pFileDialog::getOpenFileNames( QWidget* parent, const QString& caption, const QString& dir, const QString& filter, bool enabledTextCodec, bool enabledOpenReadOnly, const QString& selectedFilter, QFileDialog::Options options ) { pFileDialogResult result; pFileDialog fd( parent ); setDialog( &fd, caption, dir, filter, enabledTextCodec, enabledOpenReadOnly, selectedFilter, QFileDialog::ExistingFiles, options ); if ( fd.exec() == QDialog::Accepted ) { result[ pFileDialog::FileNames ] = fd.selectedFiles(); result[ pFileDialog::TextCodec ] = fd.textCodec(); result[ pFileDialog::OpenReadOnly ] = fd.openReadOnly(); result[ pFileDialog::SelectedFilter ] = fd.selectedFilter(); } return result; }
DisplayDialog::DisplayDialog(ProfileDoc *dc,RawData *pD,int wn):InputDialog(dc,pD,1) { short iType; Handle iHandle; Handle sHandle; Rect iRect, r,pRect,tRect; UserItemUPP box3D; QDErr error; GDHandle oldGD; GWorldPtr oldGW; RGBColor c,oldbackcolor,oldforecolor; WindowPtr oldP; OSErr err; int32 i,wi,hi; double w,h; short dtp_ids[] = DISPPATCH_IDS; Str255 theString,name; for (i=0; i<NumInputIDS; i++) ids[i] = dtp_ids[i]; WinType = DisplayWindow; WinNum = wn; setDialog(Input_Dialog); GetIndString(theString,Display_Title,1); SetWTitle( dp, theString); // Added by James, 3D the box threeD_box(ids[ThreeDBox]); //playSound(8193); // initialize the big gworld GetDItem (dp, ids[Strip_Rect], &iType, (Handle*)&iHandle, &iRect); tRect = iRect; OffsetRect(&tRect,-iRect.left,-iRect.top); error = NewGWorld( &BigGW, 32, &tRect, 0, 0, 0 ); if (error != 0) { delete this; return; } GetGWorld(&oldGW,&oldGD); SetGWorld(BigGW,nil); // GetBackColor(&oldbackcolor); GetForeColor(&oldforecolor); c.red = 65535; c.green = 65535; c.blue = 65535; RGBBackColor(&c); c.red = 0; c.green = 0; c.blue = 0; RGBForeColor(&c); // EraseRect( &tRect ); SetGWorld(oldGW,oldGD); // RGBBackColor(&oldbackcolor); RGBForeColor(&oldforecolor); // SetPort(oldP); GetDItem (dp, ids[Patch_Rect], &iType, (Handle*)&iHandle, &pRect); num_display_patch = (iRect.bottom-iRect.top)/(pRect.bottom-pRect.top); top_patch = 0; //init the static members //current_patch = total_patches-1; //current_patch = 0; current_patch = 0; current_strip = 0; current_sheet = 0; _done = 0; _waiting = 0; SetSheetStripText(); current_top = current_patch - 2*num_display_patch/3; current_bottom = current_top + num_display_patch - 1; if (current_top < 0) { current_top = 0; current_bottom = current_top + num_display_patch - 1; } if (current_bottom >= total_patches-1) { current_bottom = total_patches - 1; current_top = current_bottom - num_display_patch + 1; } current_disp = 2*num_display_patch/3; init(); getpatchRGB(); Disable(dp,ids[Redo]); GetDItem (dp, ids[Slider], &iType, (Handle*)&iHandle, &pRect); SetCtlMin((ControlHandle)iHandle,0); SetCtlMax((ControlHandle)iHandle,total_patches-1); // GetDItem ( dp,ids[Message], &iType, (Handle*)&iHandle, &pRect ); // SetIText(iHandle,"\p"); GetDItem ( dp,PatchLabel, &iType, (Handle*)&iHandle, &pRect ); GetIndString(theString,Message_List_ID,Patch_Message); SetIText(iHandle,theString); strcpy((char*)name,pD->desc); ctopstr((char*)name); SetWTitle( dp, name); DrawWindow(); }
RchooseDialog::RchooseDialog(ProfileDocInf *d,int den) { short iType; Handle iHandle; Rect iRect; long id; int i; MenuHandle menuH; int which; doc = d; density = den; _which = doc->defaults->input_type; _which_patch = doc->defaults->patch_format; _which_port = doc->defaults->port; if (_which == DT_None) _which = DT_TechkonSP820; switch (_which) { case DT_TiffFile: which = DataFile; break; case DT_DTP51: which = DTP51; break; case DT_XriteDTP41: which = DTP41; break; case DT_TechkonCP300: which = TechkonCP300; break; case DT_TechkonSP820: which = TechkonSP820; break; case DT_TechkonTCRCP300: which = TechkonTCRCP300; break; case DT_TechkonTCRSP820: which = TechkonTCRSP820; break; case DT_GretagHand: which = GretagHand; break; case DT_GretagTable: which = GretagTable; break; case DT_Xrite408: which = XR408; break; } setDialog(Rchoose_Dialog); frame_button(); for (i=0; i<MAX_PATCH_NAMES; i++) { convert[i] = 0; convert2[i] = 0; } GetDItem (dialogptr, FileType, &iType, &iHandle, &iRect); SetCtlValue((ControlHandle)iHandle,which); if ((XR408 != -1) && (!density)) { menuH = GetMenu(DeviceMenuID); DisableItem(menuH,XR408); } setDialogState(); }
AboutDialog::AboutDialog(void) { setDialog(About_Dialog); frame_button(); }
void cookStore::update() { if (_dialogType == DIALOG_ING) return; switch (_type) { case COOK_FIN: for (int i = 0; i < 2; i++) { _chooseBox[i].isSelected = false; if (PtInRect(&_chooseBox[i].rc, _ptMouse)) { _chooseBox[i].isSelected = true; if (KEYMANAGER->isOnceKeyDown(VK_LBUTTON)) { if (i == 0) _type = COOK_SELECT; else if (i == 1) _fin = true; } } } break; case COOK_SELECT: if (!_selectItem) { for (int i = 0; i < 3; i++) { _itemImg[i].frameX = 0; if (PtInRect(&_itemImg[i].data.rc, _ptMouse)) { _itemImg[i].frameX = 1; _itemImg[i].data.isChoose = false; if (KEYMANAGER->isOnceKeyDown(VK_LBUTTON)) { _selectNumber = i; _selectItem = true; _itemImg[i].data.isChoose = true; _itemImg[i].frameX = 0; string str = "「 " + _vItem[i]->getName() + "은/는 " + to_string(_vItem[i]->getPrice()) + "G 입니다.」"; setDialog(str); _type = COOK_CLICK; _dialogIdx = 0; _dialogType = DIALOG_ING; } } } } _quitImg.frameX = 0; if (PtInRect(&_quitImg.data.rc, _ptMouse)) { _quitImg.frameX = 1; if (KEYMANAGER->isOnceKeyDown(VK_LBUTTON)) { _fin = true; } } break; case COOK_CLICK: for (int i = 0; i < 3; i++) { _buyBox[i].isSelected = false; if (PtInRect(&_buyBox[i].rc, _ptMouse)) { _buyBox[i].isSelected = true; if (KEYMANAGER->isOnceKeyDown(VK_LBUTTON)) { if (i == 0) { if (_princess->getGold() >= _vItem[_selectNumber]->getPrice()) { } else { string str = "「돈이 없으니 돌아가세요.」"; setDialog(str); _type = COOK_SELECT; _selectItem = false; _dialogIdx = 0; _dialogType = DIALOG_ING; } } else if (i == 1) { _type = COOK_SELECT; _selectItem = false; } else { _fin = true; } } } } break; case COOK_NONE: break; } }
void hospital::update() { if (_dialogType == DIALOG_ING) return; switch (_type) { case HOSPITAL_SICK: if (KEYMANAGER->isOnceKeyDown(VK_LBUTTON)) { string str = "「음,이건 진찰료가 이만큼 드는데, 괜찮은가? 진찰료 " + to_string(_sickPer*2) + "G」"; setDialog(str); _type = HOSPITAL_DEMAND; _dialogIdx = 0; _dialogType = DIALOG_ING; } break; case HOSPITAL_DEMAND: for (int i = 0; i < 2; i++) { _chooseBox[i].isSelected = false; if (PtInRect(&_chooseBox[i].rc, _ptMouse)) { _chooseBox[i].isSelected = true; if (KEYMANAGER->isOnceKeyDown(VK_LBUTTON)) { if (i == 0) { if (_princess->getGold() >= _sickPer * 2) { _chooseNum = 0; string str = "「잘 치료됐네, 건강관리 잘하게.」"; setDialog(str); _dialogIdx = 0; _dialogType = DIALOG_ING; _type = HOSPITAL_CURE; _princess->setStress(_sickPer); } else { _chooseNum = 1; string str = "「돈이 없다면 돌아가게.」"; setDialog(str); _type = HOSPITAL_NOSICK; _dialogIdx = 0; _dialogType = DIALOG_ING; } } else { string str = "「이거 이거.그럼 몸조리 잘하도록...」"; setDialog(str); _type = HOSPITAL_NOSICK; _dialogIdx = 0; _dialogType = DIALOG_ING; } } } } break; case HOSPITAL_NOSICK: if (KEYMANAGER->isOnceKeyDown(VK_LBUTTON)) _fin = true; case HOSPITAL_CURE: if (KEYMANAGER->isOnceKeyDown(VK_LBUTTON)) _fin = true; break; } }
// initialize the 3D and load an object LogoWin2::LogoWin2(XyztoRgb *xtor,double mg) { TQ3Status myStatus; //Rect rBounds; FSSpec theFileSpec ; // the file we are opening Str255 title = "\p"; McoStatus status; Handle item_handle; short item_type; int Q3DIDS[] = LW_IDS; int i; priority = 3; xyztorgb = xtor; monitor_z = mg; ambient = 0.6; point = 1.5; fill = 0.2; Document.fCameraFrom.x = 0.0; Document.fCameraFrom.y = 0.0; Document.fCameraFrom.z = 30.0; Document.fCameraTo.x = 0.0; Document.fCameraTo.y = 0.0; Document.fCameraTo.z = 0.0; WinNum = 0; WinType = Startup_Dialog; // the_window = NewCWindow(nil,&rBounds,title,false,noGrowDocProc,(WindowPtr)-1,true,nil); // if (the_window == NULL) goto fail; for (i=0; i<NUM_QD3D_IDS; i++) ids[i] = Q3DIDS[i]; setDialog(ids[QD3D_Dial],0,-140); the_window = dp; GetDItem (dp, ids[QD3D_Box], &item_type, &item_handle, &box_rect); // initialise our document structure InitDocumentData( &Document ) ; num_objects = 0; status = ChangeGeometry(MP_Logo ,0); if (status != MCO_SUCCESS) goto fail; AdjustCamera( &Document, (box_rect.right - box_rect.left), (box_rect.bottom - box_rect.top) ) ; SetWTitle( the_window, "\p" ); ShowWindow( the_window ); SetPort( the_window ); DocumentDraw3DData(&Document); DocumentDrawOnscreen( &Document, &box_rect ) ; Current_Button = ids[QD3D_Rotate]; Disable(dp,ids[QD3D_Rotate]); tick_start = TickCount(); fail: return; //delete this; }
TechkonDialog::TechkonDialog(ProfileDoc *dc,RawData *pD):InputDialog(dc,pD,1) { short iType; Handle iHandle; Handle sHandle; Rect iRect, r,pRect,tRect; UserItemUPP box3D; QDErr error; GDHandle oldGD; GWorldPtr oldGW; RGBColor c,oldbackcolor,oldforecolor; WindowPtr oldP; OSErr err; int32 i,wi,hi; double w,h; short gtsl_ids[] = GTSL_IDS; Str255 theString; PixMapHandle bigPixMap; McoStatus state; for (i=0; i<NumInputIDS; i++) ids[i] = gtsl_ids[i]; WinType = TechkonWindow; WinNum = 0; setDialog(Input_Dialog); frame_button(ids[Ok_Box]); // Added by James, 3D the box threeD_box(ids[ThreeDBox]); HideDItem(dp,ids[Redo]); GetDItem ( dp,ids[Message], &iType, (Handle*)&iHandle, &iRect ); GetIndString(theString,Message_List_ID,6); SetIText(iHandle,theString); Scramble = FALSE; if (Scramble) { voice_set = 1; } else { Disable(dp,ids[VoiceSet]); voice_set = 2; } // initialize comminications with the device state = doc->openInputDevice(0,0,0); if (state != MCO_SUCCESS) McoErrorAlert(state); // initialize the big gworld GetDItem (dp, ids[Strip_Rect], &iType, (Handle*)&iHandle, &iRect); tRect = iRect; OffsetRect(&tRect,-iRect.left,-iRect.top); error = NewGWorld( &BigGW, 32, &tRect, 0, 0, 0 ); if (error != 0) { delete this; return; } GetGWorld(&oldGW,&oldGD); SetGWorld(BigGW,nil); // GetBackColor(&oldbackcolor); GetForeColor(&oldforecolor); c.red = 65535; c.green = 65535; c.blue = 65535; RGBBackColor(&c); c.red = 0; c.green = 0; c.blue = 0; RGBForeColor(&c); bigPixMap = GetGWorldPixMap ( BigGW ); if (LockPixels ( bigPixMap )) EraseRect( &tRect ); SetGWorld(oldGW,oldGD); // RGBBackColor(&oldbackcolor); RGBForeColor(&oldforecolor); // SetPort(oldP); GetDItem (dp, ids[Patch_Rect], &iType, (Handle*)&iHandle, &pRect); num_display_patch = (iRect.bottom-iRect.top)/(pRect.bottom-pRect.top); top_patch = 0; //init the static members //current_patch = total_patches-1; //current_patch = 0; current_patch = 0; current_strip = 0; current_sheet = 0; _done = 0; _waiting = 0; SetSheetStripText(); current_top = current_patch - 2*num_display_patch/3; current_bottom = current_top + num_display_patch - 1; if (current_top < 0) { current_top = 0; current_bottom = current_top + num_display_patch - 1; } if (current_bottom >= total_patches-1) { current_bottom = total_patches - 1; current_top = current_bottom - num_display_patch + 1; } current_disp = 2*num_display_patch/3; init(); getpatchRGB(); Disable(dp,ids[Redo]); GetDItem (dp, ids[Slider], &iType, (Handle*)&iHandle, &pRect); SetCtlMin((ControlHandle)iHandle,0); SetCtlMax((ControlHandle)iHandle,total_patches-1); GetDItem(dp, ids[VoiceSet], &iType, (Handle*)&iHandle, &pRect); SetCtlValue((ControlHandle)iHandle,1); //voice_set = 1; checkFinished(); DrawWindow(); }
SpChInDialog::SpChInDialog(ProfileDoc *dc,RawData *pD):TableDialog(dc,pD) { short iType; Handle iHandle; Handle sHandle; Rect iRect, r,pRect,tRect; UserItemUPP box3D; QDErr error; GDHandle oldGD; GWorldPtr oldGW; RGBColor c,oldbackcolor,oldforecolor; WindowPtr oldP; OSErr err; int32 i,wi,hi; double w,h; short spc_ids[] = SPC_IDS; McoStatus state; int papernum; for (i=0; i<NumInputIDS; i++) ids[i] = spc_ids[i]; WinType = StripDialog; WinNum = 0; setDialog(Input_Dialog); frame_button(ids[Ok_Box]); SetSheetStripText(); // Added by James, 3D the box threeD_box(ids[ThreeDBox]); // initialize comminications with the specrolino state = doc->openInputDevice(0,0,0); if (state != MCO_SUCCESS) McoErrorAlert(state); w = patchD->patches.width; h = patchD->patches.height; if (patchD->type == CMYKPatches) papernum = 0; else if (patchD->type == RGBPatches) papernum = patchD->format.total; if (doc->tcom != 0L) ((SpectroChart*)(doc->tcom))->setUpPatches(patchD->patches.columns,patchD->patches.rows,w,h,patchD->patches.starting,patchD->patches.direction,papernum); if (doc->tcom->device_num != DT_GretagTable) { McoErrorAlert(MCO_FAILURE); } // initialize the big gworld GetDItem (dp, ids[Strip_Rect], &iType, (Handle*)&iHandle, &iRect); tRect = iRect; OffsetRect(&tRect,-iRect.left,-iRect.top); error = NewGWorld( &BigGW, 32, &tRect, 0, 0, 0 ); if (error != 0) { delete this; return; } GetGWorld(&oldGW,&oldGD); SetGWorld(BigGW,nil); // GetBackColor(&oldbackcolor); GetForeColor(&oldforecolor); c.red = 65535; c.green = 65535; c.blue = 65535; RGBBackColor(&c); c.red = 0; c.green = 0; c.blue = 0; RGBForeColor(&c); // EraseRect( &tRect ); SetGWorld(oldGW,oldGD); // RGBBackColor(&oldbackcolor); RGBForeColor(&oldforecolor); // SetPort(oldP); GetDItem (dp, ids[Patch_Rect], &iType, (Handle*)&iHandle, &pRect); num_display_patch = (iRect.bottom-iRect.top)/(pRect.bottom-pRect.top); top_patch = 0; current_top = current_patch - 2*num_display_patch/3; current_bottom = current_top + num_display_patch - 1; if (current_top < 0) { current_top = 0; current_bottom = current_top + num_display_patch - 1; } if (current_bottom >= total_patches-1) { current_bottom = total_patches - 1; current_top = current_bottom - num_display_patch + 1; } current_disp = 2*num_display_patch/3; init(); getpatchRGB(); dtype = DType_Density; Disable(dp,ids[Redo]); GetDItem (dp, ids[Slider], &iType, (Handle*)&iHandle, &pRect); SetCtlMin((ControlHandle)iHandle,0); SetCtlMax((ControlHandle)iHandle,total_patches-1); if (ids[VoiceSet] > -1) { GetDItem(dp, ids[VoiceSet], &iType, (Handle*)&iHandle, &pRect); SetCtlValue((ControlHandle)iHandle,1); } //voice_set = 1; if (ids[Lift] > -1) HideDItem(dp,ids[Lift]); checkFinished(); DrawWindow(); }