void Ide::SetMain(const String& package) { FlushFile(); SaveWorkspace(); transferfilecache.Clear(); main = package; export_dir = GetHomeDirFile(main); mainconfigname.Clear(); mainconfigparam.Clear(); ScanWorkspace(); LoadFromFile(THISBACK(SerializeWorkspace), WorkspaceFile()); editorsplit.Zoom(0); UpdateFormat(); String e = editfile; editfile.Clear(); MakeTitle(); MakeIcon(); SyncMainConfigList(); AdjustMainConfig(); SyncBuildMode(); SetHdependDirs(); SetBar(); HideBottom(); SyncUsc(); NewCodeBase(); if(IsNull(e)) e = GetFirstFile(); EditFile(e); }
/* * initializeImage - initialize the bitmaps according to the image type */ static void initializeImage( img_node *node, const char *filename ) { node->imgtype = imgType; node->width = imgWidth; node->height = imgHeight; node->bitcount = bitCount; node->hotspot.x = 0; node->hotspot.y = 0; node->num_of_images = 1; node->nexticon = NULL; node->issaved = TRUE; node->next = NULL; if( filename != NULL ) { strcpy( node->fname, filename ); } else { sprintf( node->fname, "%s.%d", IEImageUntitled, imageCount ); } if( imgType == BITMAP_IMG ) { MakeBitmap( node, TRUE ); } else { MakeIcon( node, TRUE ); // also makes cursors } } /* initializeImage */
/* * doReadCursor */ BOOL doReadCursor( char *fname, an_img_file *cursorfile, an_img *cursor, WRInfo *info, WResLangNode *lnode ) { img_node node; HDC hdc; char filename[_MAX_FNAME + _MAX_EXT]; if( cursorfile == NULL || cursor == NULL ) { return( FALSE ); } GetFnameFromPath( fname, filename ); node.imgtype = CURSOR_IMG; node.width = cursor->bm->bmiHeader.biWidth; node.height = cursor->bm->bmiHeader.biHeight; if( node.height == 0 ) { node.height = node.width; } node.bitcount = cursor->bm->bmiHeader.biBitCount; node.hotspot.x = cursorfile->resources->xhotspot; node.hotspot.y = cursorfile->resources->yhotspot; node.issaved = TRUE; node.num_of_images = 1; node.next = NULL; node.nexticon = NULL; node.wrinfo = info; node.lnode = lnode; hdc = GetDC( NULL ); node.handbitmap = ImgToAndBitmap( hdc, cursor ); node.hxorbitmap = ImgToXorBitmap( hdc, cursor ); ReleaseDC( NULL, hdc ); strcpy( node.fname, strupr( fname ) ); ImageFini( cursor ); ImageClose( cursorfile ); PrintHintTextByID( WIE_OPENEDTEXT, filename ); MakeIcon( &node, FALSE ); // also makes cursors CreateNewDrawPad( &node ); return( TRUE ); } /* doReadCursor */
void DialogTransformVolume::UpdateLandmarkColors() { LayerLandmarks* landmarks = (LayerLandmarks*)MainWindow::GetMainWindow() ->GetSupplementLayer("Landmarks"); for (int i = 0; i < m_colorPickerLandmark.size(); i++) { if (qobject_cast<QtColorPicker*>(sender()) == m_colorPickerLandmark[i]) { landmarks->SetLandmarkColor(i, m_colorPickerLandmark[i]->currentColor()); break; } } QList<QColor> colors; for (int i = 0; i < m_colorPickerLandmark.size(); i++) colors << landmarks->GetLandmark(i).color; foreach (QComboBox* cbox, m_comboLandmark) { for (int i = 0; i < m_colorPickerLandmark.size(); i++) cbox->setItemIcon(i, MakeIcon(colors[i], 12)); } }