コード例 #1
0
ファイル: queue.cpp プロジェクト: ErichKrause/filezilla
CQueueViewBase::CQueueViewBase(CQueue* parent, int index, const wxString& title)
	: wxListCtrlEx(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxCLIP_CHILDREN | wxLC_REPORT | wxLC_VIRTUAL | wxSUNKEN_BORDER | wxTAB_TRAVERSAL),
	  m_pageIndex(index), m_title(title)
{
	m_pQueue = parent;
	m_insertionStart = -1;
	m_insertionCount = 0;
	m_itemCount = 0;
	m_allowBackgroundErase = true;

	m_fileCount = 0;
	m_folderScanCount = 0;
	m_fileCountChanged = false;
	m_folderScanCountChanged = false;

	// Create and assign the image list for the queue
	wxImageList* pImageList = new wxImageList(16, 16);

	pImageList->Add(wxArtProvider::GetBitmap(_T("ART_SERVER"),  wxART_OTHER, wxSize(16, 16)));
	pImageList->Add(wxArtProvider::GetBitmap(_T("ART_FILE"),  wxART_OTHER, wxSize(16, 16)));
	pImageList->Add(wxArtProvider::GetBitmap(_T("ART_FOLDERCLOSED"),  wxART_OTHER, wxSize(16, 16)));
	pImageList->Add(wxArtProvider::GetBitmap(_T("ART_FOLDER"),  wxART_OTHER, wxSize(16, 16)));

	AssignImageList(pImageList, wxIMAGE_LIST_SMALL);

	m_filecount_delay_timer.SetOwner(this);
}
コード例 #2
0
//------------------------------------------------------------------------------
void OutputTree::AddIcons()
{
   int size = 16;
  
   wxImageList *images = new wxImageList ( size, size, true );
  
   wxBusyCursor wait;
   wxIcon icons[GmatTree::OUTPUT_ICON_COUNT];
   
   icons[GmatTree::OUTPUT_ICON_CLOSEDFOLDER] = wxIcon(ClosedFolder_xpm);
   icons[GmatTree::OUTPUT_ICON_OPENFOLDER] = wxIcon(OpenFolder_xpm);
   icons[GmatTree::OUTPUT_ICON_REPORTFILE] = wxIcon(report_xpm);
   icons[GmatTree::OUTPUT_ICON_ORBITVIEW] = wxIcon(openglplot_xpm);
   icons[GmatTree::OUTPUT_ICON_XYPLOT] = wxIcon(xyplot_xpm);
   icons[GmatTree::OUTPUT_ICON_FILE] = wxIcon(file_xpm);
   icons[GmatTree::OUTPUT_ICON_DEFAULT] = wxIcon(default_xpm);
   
   int sizeOrig = icons[0].GetWidth();
   for ( size_t i = 0; i < WXSIZEOF(icons); i++ )
   {
      if ( size == sizeOrig )
         images->Add(icons[i]);
      else
         images->Add(wxBitmap(wxBitmap(icons[i]).ConvertToImage().Rescale(size, size)));
   }
   
   AssignImageList(images);

}
コード例 #3
0
ファイル: PHPOutlineTree.cpp プロジェクト: lpc1996/codelite
void PHPOutlineTree::BuildTree(const wxFileName& filename)
{
    m_filename = filename;
    PHPSourceFile sourceFile(filename, NULL);
    sourceFile.SetParseFunctionBody(false);
    sourceFile.Parse();
    wxWindowUpdateLocker locker(this);
    DeleteAllItems();

    wxTreeItemId root = AddRoot(wxT("Root"));

    wxImageList* images = new wxImageList(clGetScaledSize(16), clGetScaledSize(16), true);
    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/globals")));            // 0
    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/function_private")));   // 1
    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/function_protected"))); // 2
    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/function_public")));    // 3
    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/member_private")));     // 4
    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/member_protected")));   // 5
    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/member_public")));      // 6
    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/namespace")));          // 7
    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/class")));              // 8
    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/enumerator")));         // 9
    AssignImageList(images);

    // Build the tree view
    BuildTree(root, sourceFile.Namespace());

    if(HasChildren(GetRootItem())) {
        ExpandAll();
    }
}
コード例 #4
0
bool wxSTEditorTreeCtrl::Create(wxWindow *parent, wxWindowID id,
                                const wxPoint& pos, const wxSize& size,
                                long style, const wxString& name)
{
    if (!wxTreeCtrl::Create(parent, id, pos, size, style, wxDefaultValidator, name))
        return false;

    wxImageList* imageList = new wxImageList(16, 16, true, 3);
    imageList->Add(wxArtProvider::GetBitmap(wxART_FOLDER,      wxART_MENU, wxSize(16, 16)));
    imageList->Add(wxArtProvider::GetBitmap(wxART_NORMAL_FILE, wxART_MENU, wxSize(16, 16)));
    imageList->Add(wxArtProvider::GetBitmap(wxART_REPORT_VIEW, wxART_MENU, wxSize(16, 16)));
    AssignImageList(imageList);

    m_popupMenu = new wxMenu;
    m_popupMenu->Append(ID_STT_FILE_OPEN,  wxGetStockLabelEx(wxID_OPEN), _("Open file"));
    m_popupMenu->Append(ID_STT_FILE_CLOSE, _("Close"), _("Close selected page"));
    m_popupMenu->Append(ID_STT_FILE_PROPERTIES, wxGetStockLabelEx(wxID_PROPERTIES), _("Show document properties dialog"));
    m_popupMenu->AppendSeparator();
    m_popupMenu->Append(ID_STT_EXPAND_ALL,   _("Expand all paths"),   _("Expand all paths"));
    m_popupMenu->Append(ID_STT_COLLAPSE_ALL, _("Collapse all paths"), _("Collapse all paths"));
    m_popupMenu->AppendSeparator();
    m_popupMenu->AppendRadioItem(ID_STT_SHOW_FILENAME_ONLY,      _("Show only the filename"), _("Show only the filename"));
    m_popupMenu->AppendRadioItem(ID_STT_SHOW_FILEPATH_ONLY,      _("Show only the full file path"), _("Show only the full file path"));
    m_popupMenu->AppendRadioItem(ID_STT_SHOW_PATH_THEN_FILENAME, _("Show files grouped by paths"), _("Show files grouped by paths"));
    m_popupMenu->AppendRadioItem(ID_STT_SHOW_ALL_PATHS,          _("Show all paths"), _("Show all paths"));

    m_popupMenu->Check(ID_STT_SHOW_PATH_THEN_FILENAME, true);

    return true;
}
コード例 #5
0
//---------------------------------------------------------
CACTIVE::CACTIVE(wxWindow *pParent)
	: wxNotebook(pParent, ID_WND_ACTIVE, wxDefaultPosition, wxDefaultSize, wxNB_TOP|wxNB_MULTILINE, _TL("Properties"))
{
	g_pACTIVE		= this;

	m_pItem			= NULL;

	//-----------------------------------------------------
	AssignImageList(new wxImageList(IMG_SIZE_NOTEBOOK, IMG_SIZE_NOTEBOOK, true, 0));

	IMG_ADD_TO_NOTEBOOK(ID_IMG_NB_ACTIVE_PARAMETERS);
	IMG_ADD_TO_NOTEBOOK(ID_IMG_NB_ACTIVE_DESCRIPTION);
	IMG_ADD_TO_NOTEBOOK(ID_IMG_NB_ACTIVE_HISTORY);
	IMG_ADD_TO_NOTEBOOK(ID_IMG_NB_ACTIVE_ATTRIBUTES);
	IMG_ADD_TO_NOTEBOOK(ID_IMG_NB_ACTIVE_LEGEND);

	//-----------------------------------------------------
	m_pParameters	= new CACTIVE_Parameters	(this);	m_pParameters	->SetName(_TL("Settings"));
	m_pDescription	= new CACTIVE_Description	(this);	m_pDescription	->SetName(_TL("Description"));
	m_pHistory		= new CACTIVE_History		(this);	m_pHistory		->SetName(_TL("History"));
	m_pLegend		= new CACTIVE_Legend		(this);	m_pLegend		->SetName(_TL("Legend"));
	m_pAttributes	= new CACTIVE_Attributes	(this);	m_pAttributes	->SetName(_TL("Attributes"));

#if defined(_SAGA_MSW)
	m_pParameters	->Hide();
	m_pDescription	->Hide();
	m_pHistory		->Hide();
	m_pLegend		->Hide();
	m_pAttributes	->Hide();
#endif
}
コード例 #6
0
void OPJMarkerTree::CreateImageList(int size)
{
    if (size == -1) {
        SetImageList(NULL);
        return;
    }
    if (size == 0)
        size = m_imageSize;
    else
        m_imageSize = size;

    // Make an image list containing small icons
    wxImageList *images = new wxImageList(size, size, true);

    // should correspond to TreeCtrlIcon_xxx enum
    wxBusyCursor wait;
    wxIcon icons[5];
    icons[0] = wxIcon(icon1_xpm);
    icons[1] = wxIcon(icon2_xpm);
    icons[2] = wxIcon(icon3_xpm);
    icons[3] = wxIcon(icon4_xpm);
    icons[4] = wxIcon(icon5_xpm);

    int sizeOrig = icons[0].GetWidth();
    for (size_t i = 0; i < WXSIZEOF(icons); i++) {
        if (size == sizeOrig) {
            images->Add(icons[i]);
        } else {
            images->Add(wxBitmap(wxBitmap(icons[i]).ConvertToImage().Rescale(size, size)));
        }
    }

    AssignImageList(images);
}
コード例 #7
0
//---------------------------------------------------------
CWKSP::CWKSP(wxWindow *pParent)
	: wxNotebook(pParent, ID_WND_WKSP, wxDefaultPosition, wxDefaultSize, wxNB_TOP|wxNB_MULTILINE, _TL("Manager"))
{
	wxNotebook	*pNotebook;

	//-----------------------------------------------------
	g_pWKSP		= this;

	//-----------------------------------------------------
	AssignImageList(new wxImageList(IMG_SIZE_NOTEBOOK, IMG_SIZE_NOTEBOOK, true, 0));

	IMG_ADD_TO_NOTEBOOK(ID_IMG_NB_WKSP_TOOLS);
	IMG_ADD_TO_NOTEBOOK(ID_IMG_NB_WKSP_DATA);
	IMG_ADD_TO_NOTEBOOK(ID_IMG_NB_WKSP_MAPS);

	//-----------------------------------------------------
	m_pTools		= new CWKSP_Tool_Control(this);

	SUBNB_CREATE(ID_WND_WKSP_DATA, _TL("Data"));
	m_pData			= new CWKSP_Data_Control(pNotebook);
	m_pData_Buttons	= new CWKSP_Data_Buttons(pNotebook);

	SUBNB_CREATE(ID_WND_WKSP_MAPS, _TL("Maps"));
	m_pMaps			= new CWKSP_Map_Control (pNotebook);
	m_pMaps_Buttons	= new CWKSP_Map_Buttons (pNotebook);
}
コード例 #8
0
void ListCtrlImproved::DoInitialize()
{
	m_checkedBmp   = wxBitmap(Checkbox_checked_xpm);
	m_uncheckedBmp = wxBitmap(Checkbox_unchecked_xpm);

	wxImageList *imageList = new wxImageList(16, 16, true);
	imageList->Add(m_checkedBmp);
	imageList->Add(m_uncheckedBmp);
	AssignImageList(imageList, wxIMAGE_LIST_SMALL);
}
コード例 #9
0
ファイル: listview.cpp プロジェクト: hugofvw/wxExtension
wxExListView::wxExListView(wxWindow* parent,
  wxWindowID id,
  const wxPoint& pos,
  const wxSize& size,
  long style,
  wxExImageType image_type,
  const wxValidator& validator,
  const wxString &name)
  : wxListView(parent, id, pos, size, style, validator, name)
  , m_FieldSeparator('\t')
  , m_ImageType(image_type)
  , m_ImageHeight(16)
  , m_ImageWidth(16)
  , m_SortedColumnNo(-1)
{
#if wxUSE_DRAG_AND_DROP
  SetDropTarget(new ListViewDropTarget(this));
#endif

  if (image_type != IMAGE_NONE)
  {
    if (image_type == IMAGE_ART || image_type == IMAGE_OWN)
    {
      AssignImageList(
        new wxImageList(
          m_ImageWidth, 
          m_ImageHeight, true, 0), 
        wxIMAGE_LIST_SMALL);
    }
    else if (image_type == IMAGE_FILE_ICON)
    {
      SetImageList(
        wxTheFileIconsTable->GetSmallImageList(), 
        wxIMAGE_LIST_SMALL);
    }
    else
    {
      wxFAIL;
    }
  }

  SetFont(wxConfigBase::Get()->ReadObject(
    _("List Font"), wxSystemSettings::GetFont(wxSYS_OEM_FIXED_FONT)));

  wxAcceleratorEntry entries[4];

  entries[0].Set(wxACCEL_NORMAL, WXK_DELETE, wxID_DELETE);
  entries[1].Set(wxACCEL_CTRL, WXK_INSERT, wxID_COPY);
  entries[2].Set(wxACCEL_SHIFT, WXK_INSERT, wxID_PASTE);
  entries[3].Set(wxACCEL_SHIFT, WXK_DELETE, wxID_CUT);

  wxAcceleratorTable accel(WXSIZEOF(entries), entries);
  SetAcceleratorTable(accel);
}
コード例 #10
0
ファイル: wfilelist.cpp プロジェクト: gatlex/cryptote
void WFileList::BuildImageList()
{
    {
        wxImageList* imagelist = new wxImageList(16, 16);
        imagelist->Add(BitmapCatalog::GetFileTypeBitmap(myID_FILETYPE_BINARY));
        imagelist->Add(BitmapCatalog::GetFileTypeBitmap(myID_FILETYPE_TEXT));
        imagelist->Add(BitmapCatalog::GetFileTypeBitmap(myID_FILETYPE_IMAGE));

        AssignImageList(imagelist, wxIMAGE_LIST_SMALL);
    }

    {
        wxImageList* imagelist = new wxImageList(32, 32);
        imagelist->Add(BitmapCatalog::GetFileTypeBitmap(myID_FILETYPE_BINARY_LARGE));
        imagelist->Add(BitmapCatalog::GetFileTypeBitmap(myID_FILETYPE_TEXT_LARGE));
        imagelist->Add(BitmapCatalog::GetFileTypeBitmap(myID_FILETYPE_IMAGE_LARGE));

        AssignImageList(imagelist, wxIMAGE_LIST_NORMAL);
    }
}
コード例 #11
0
ファイル: ChatSelector.cpp プロジェクト: geekt/amule
CChatSelector::CChatSelector(wxWindow* parent, wxWindowID id, const wxPoint& pos, wxSize siz, long style)
: CMuleNotebook(parent, id, pos, siz, style)
{
	wxImageList* imagelist = new wxImageList(16,16);

	// Chat icon -- default state
	imagelist->Add(wxBitmap(chat_ico_xpm));
	// Close icon -- on mouseover
	imagelist->Add(amuleSpecial(4));

	AssignImageList(imagelist);
}
コード例 #12
0
bool ResultCheckListCtrl::LoadIcons()
{
    //FIXME : Manual delete need
    fImageList = new wxImageList(16, 16, true);
    AssignImageList(fImageList, wxIMAGE_LIST_SMALL);

    fImageList->Add(wxIcon(checked_xpm));
    fImageList->Add(wxIcon(unchecked_xpm));
    fImageList->Add(wxIcon(folder_xpm));

    return true;
}
コード例 #13
0
/// Load the icons
bool wxCheckListCtrl::LoadIcons()
{
  fImageList = new wxImageList(16, 16, true);
  AssignImageList(fImageList, wxIMAGE_LIST_SMALL);

  fImageList->Add(wxIcon(checked_xpm));
  fImageList->Add(wxIcon(checked_dis_xpm));
  fImageList->Add(wxIcon(unchecked_xpm));
  fImageList->Add(wxIcon(unchecked_dis_xpm));

  return true;
}
コード例 #14
0
void ResourcesPage::initIcons()
{
	imageList = new wxImageList(16, 16, false, 8);
	imageList->Add(wxMEMORY_BITMAP(bullet_blue));
	CREATE_RESOURCE_ICON( General, package )
	CREATE_RESOURCE_ICON( Images, image )
	CREATE_RESOURCE_ICON( Meshes, shape_flip_horizontal )
	CREATE_RESOURCE_ICON( Fonts, font )
	CREATE_RESOURCE_ICON( Shaders, script_palette )
	CREATE_RESOURCE_ICON( Audio, music )
	CREATE_RESOURCE_ICON( Scripts, page_code )
	CREATE_RESOURCE_ICON( Materials, palette )
	AssignImageList(imageList);
}
コード例 #15
0
ファイル: BulletTree.cpp プロジェクト: jjiezheng/pap_full
void BulletTree::CreateImageList(int size)
{
	if ( size == -1 )
	{
		SetImageList(NULL);
		return;
	}
	if ( size == 0 )
		size = m_imageSize;
	else
		m_imageSize = size;

	// Make an image list containing small icons
	wxImageList *images = new wxImageList(size, size, true);

	// should correspond to TreeCtrlIcon_xxx enum
	wxBusyCursor wait;
	wxBitmap bitmaps[12];
	bitmaps[0] = wxBITMAP(ANIMBULLETFLOW);
	bitmaps[1] = wxBITMAP(BULLETSYSTEM);
	bitmaps[2] = wxBITMAP(EVENT);
	bitmaps[3] = wxBITMAP(ANIMEFFECT);
	bitmaps[4] = wxBITMAP(CAMERASHAKE);
	bitmaps[5] = wxBITMAP(RIBBON);
	bitmaps[6] = wxBITMAP(SOUND);
	bitmaps[7] = wxBITMAP(SCENELIGHT);
	bitmaps[8] = wxBITMAP(LINE);
	bitmaps[9] = wxBITMAP(EFFECTPROPERTY);
	bitmaps[10] = wxBITMAP(OPERATOR);
	bitmaps[11] = wxBITMAP(TESTER);


	int sizeOrig = bitmaps[0].GetWidth();
	for ( size_t i = 0; i < WXSIZEOF(bitmaps); i++ )
	{
		if ( size == sizeOrig )
		{
			images->Add(bitmaps[i]);
		}
		else
		{
			images->Add(wxBitmap(bitmaps[i].ConvertToImage().Rescale(size, size)));
		}
	}

	AssignImageList(images);

}
コード例 #16
0
ファイル: DirectoryTreeCtrl.cpp プロジェクト: geekt/amule
void CDirectoryTreeCtrl::Init()
{
	// already done ?
	if (m_IsInit) {
		return;
	}
	m_IsInit = true;

	// init image(s)
	wxImageList* images = new wxImageList(16, 16);
	images->Add(wxBitmap(amuleSpecial(1)));
	images->Add(wxBitmap(amuleSpecial(2)));
	// Gives wxTreeCtrl ownership of the list
	AssignImageList(images);


	// Create an empty root item, which we can
	// safely append when creating a full path.
	m_root = AddRoot(wxEmptyString, IMAGE_FOLDER, -1,
					new CItemData(CPath()));

	if (!m_IsRemote) {
	#ifndef __WXMSW__
		AddChildItem(m_root, CPath(wxT("/")));
	#else
		// this might take awhile, so change the cursor
		::wxSetCursor(*wxHOURGLASS_CURSOR);
		// retrieve bitmask of all drives available
		uint32 drives = GetLogicalDrives();
		drives >>= 1;
		for (char drive = 'C'; drive <= 'Z'; drive++) {
			drives >>= 1;
			if (! (drives & 1)) { // skip non existant drives
				continue;
			}
			wxString driveStr = CFormat(wxT("%c:")) % drive;
			uint32 type = GetDriveType(driveStr + wxT("\\"));

			// skip removable/undefined drives, share only fixed or remote drives
			if ((type == 3 || type == 4)   // fixed drive / remote drive
				&& CPath::DirExists(driveStr)) {
				AddChildItem(m_root, CPath(driveStr));
			}
		}
		::wxSetCursor(*wxSTANDARD_CURSOR);
	#endif
	}
コード例 #17
0
HIERARCHY_TREE::HIERARCHY_TREE( HIERARCHY_NAVIG_DLG* parent ) :
    wxTreeCtrl( (wxWindow*) parent, wxID_ANY, wxDefaultPosition, wxDefaultSize,
                wxTR_HAS_BUTTONS, wxDefaultValidator, wxT( "HierachyTreeCtrl" ) )
{
    m_parent = parent;

    // Make an image list containing small icons
    // All icons are expected having the same size.
    wxBitmap tree_nosel_bm( KiBitmap( tree_nosel_xpm ) );
    imageList = new wxImageList( tree_nosel_bm.GetWidth(),
                                 tree_nosel_bm.GetHeight(), true, 2 );

    imageList->Add( tree_nosel_bm );
    imageList->Add( KiBitmap( tree_sel_xpm ) );

    AssignImageList( imageList );
}
コード例 #18
0
//---------------------------------------------------------
CACTIVE_History::CACTIVE_History(wxWindow *pParent)
	: wxTreeCtrl(pParent, ID_WND_ACTIVE_HISTORY , wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS)
{
	AssignImageList(new wxImageList(IMG_SIZE_TREECTRL, IMG_SIZE_TREECTRL, true, 0));
	IMG_ADD_TO_TREECTRL(ID_IMG_NB_ACTIVE_HISTORY);		// ROOT
	IMG_ADD_TO_TREECTRL(ID_IMG_TB_MAP_ZOOM_NEXT);		// NODE
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_TOOL);			// TOOL
	IMG_ADD_TO_TREECTRL(ID_IMG_TB_INFO);				// ENTRY
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_GRID);				// GRID
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_TABLE);				// TABLE
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_SHAPES_POLYGON);	// SHAPES
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_POINTCLOUD);		// POINTCLOUD
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_TIN);				// TIN
	IMG_ADD_TO_TREECTRL(ID_IMG_TB_OPEN);				// FILE

	m_pItem		= NULL;
}
コード例 #19
0
ファイル: Playlist.cpp プロジェクト: renny1398/rennypsf
PSFPlaylist::PSFPlaylist(wxWindow* parent, wxWindowID id)
    : wxTreeCtrl(parent, id, wxDefaultPosition, wxDefaultSize, wxTR_HAS_BUTTONS | wxTR_TWIST_BUTTONS | wxTR_HIDE_ROOT)
{
    rootId = AddRoot(wxT("Root"));  // "Root" is dummy

	// register folder and file icons
    wxImageList *treeImage = new wxImageList(0, 0);
	wxBitmap idx0 = wxArtProvider::GetBitmap(wxART_FOLDER, wxART_OTHER);
	wxBitmap idx1 = wxArtProvider::GetBitmap(wxART_NEW, wxART_OTHER);
	treeImage->Add(idx0);
	treeImage->Add(idx1);
	AssignImageList(treeImage);

    fdt = new PSFFileDropTarget(this);
    SetDropTarget(fdt);
//    DragAcceptFiles(true);
}
コード例 #20
0
ファイル: lst_custom.cpp プロジェクト: JohnnyonFlame/odamex
// Add any additional bitmaps/icons to the internal image list
void wxAdvancedListCtrl::AddImageSmall(wxImage Image)
{
    if (GetImageList(wxIMAGE_LIST_SMALL) == NULL)
    {
        // Art provider images are 16x15, WTF?! Kept for compatibility :'(
        wxImageList *ImageList = new wxImageList(16, 15, true, FIRST_IMAGE);
        AssignImageList(ImageList, wxIMAGE_LIST_SMALL);
        
        // Add our sort icons by default.
        GetImageList(wxIMAGE_LIST_SMALL)->Add(wxImage(SortArrowAscending));
        GetImageList(wxIMAGE_LIST_SMALL)->Add(wxImage(SortArrowDescending));
    }
    
    if (Image.IsOk())
    {
        GetImageList(wxIMAGE_LIST_SMALL)->Add(Image);
    }
}
コード例 #21
0
ファイル: queue.cpp プロジェクト: comutt/FileZilla3
CQueueViewBase::CQueueViewBase(CQueue* parent, int index, const wxString& title)
    : wxListCtrlEx(parent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxCLIP_CHILDREN | wxLC_REPORT | wxLC_VIRTUAL | wxSUNKEN_BORDER | wxTAB_TRAVERSAL)
    , m_pageIndex(index)
    , m_title(title)
{
    m_pQueue = parent;

    // Create and assign the image list for the queue
    wxSize s = CThemeProvider::GetIconSize(iconSizeSmall);
    wxImageList* pImageList = new wxImageList(s.x, s.y);

    pImageList->Add(CThemeProvider::Get()->CreateBitmap(_T("ART_SERVER"), wxART_OTHER, CThemeProvider::GetIconSize(iconSizeSmall)));
    pImageList->Add(CThemeProvider::Get()->CreateBitmap(_T("ART_FILE"), wxART_OTHER, CThemeProvider::GetIconSize(iconSizeSmall)));
    pImageList->Add(CThemeProvider::Get()->CreateBitmap(_T("ART_FOLDER"), wxART_OTHER, CThemeProvider::GetIconSize(iconSizeSmall)));

    AssignImageList(pImageList, wxIMAGE_LIST_SMALL);

    m_filecount_delay_timer.SetOwner(this);
}
コード例 #22
0
// Add any additional bitmaps/icons to the internal image list
int wxAdvancedListCtrl::AddImageSmall(wxImage Image)
{
    if (GetImageList(wxIMAGE_LIST_SMALL) == NULL)
    {
        wxImageList *ImageList = new wxImageList(16, 16, true);
        AssignImageList(ImageList, wxIMAGE_LIST_SMALL);

        // Add our sort icons by default.
        ImageList_SortArrowUp = GetImageList(wxIMAGE_LIST_SMALL)->Add(wxImage(SortArrowAscending));
        ImageList_SortArrowDown = GetImageList(wxIMAGE_LIST_SMALL)->Add(wxImage(SortArrowDescending));
    }

    if (Image.IsOk())
    {
        return GetImageList(wxIMAGE_LIST_SMALL)->Add(Image);
    }

    return -1;
}
コード例 #23
0
//---------------------------------------------------------
CData_Source_PgSQL::CData_Source_PgSQL(wxWindow *pParent)
	: wxTreeCtrl(pParent, ID_WND_DATA_SOURCE_DATABASE)
{
	AssignImageList(new wxImageList(IMG_SIZE_TREECTRL, IMG_SIZE_TREECTRL, true, 0));
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_DB_SOURCES    );	// IMG_ROOT
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_DB_SOURCES    );	// IMG_SERVER
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_DB_SOURCE_OFF );	// IMG_SRC_CLOSED
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_DB_SOURCE_ON  );	// IMG_SRC_OPENED
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_DB_TABLE      );	// IMG_TABLE
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_SHAPES_POINT  );	// IMG_POINT
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_SHAPES_POINTS );	// IMG_POINTS
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_SHAPES_LINE   );	// IMG_LINE
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_SHAPES_POLYGON);	// IMG_POLYGON
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_GRID_MANAGER  );	// IMG_GRIDS
	IMG_ADD_TO_TREECTRL(ID_IMG_WKSP_GRID          );	// IMG_GRID

	AddRoot(_TL("PostgreSQL Sources"), IMG_ROOT, IMG_ROOT, new CData_Source_PgSQL_Data(TYPE_ROOT));

	//-----------------------------------------------------
	SG_UI_Msg_Lock(true);

	wxString	Server;

	for(int i=0; CONFIG_Read(CFG_PGSQL_DIR, wxString::Format(CFG_PGSQL_SRC, i), Server); i++)
	{
		wxString	User, Password;

		if( Server.Find("|") > 0 )
		{
			User     = Server.AfterFirst ('|').BeforeFirst('|');
			Password = Server.AfterLast  ('|');
			Server   = Server.BeforeFirst('|');
		}

		CData_Source_PgSQL_Data	*pData	= new CData_Source_PgSQL_Data(TYPE_SOURCE, &Server, &Server, &User, &Password);

		Update_Source(AppendItem(Get_Server_Item(Server, true), pData->Get_DBName().c_str(), IMG_SRC_CLOSED, IMG_SRC_CLOSED, pData));
	}

	Update_Sources();

	SG_UI_Msg_Lock(false);
}
コード例 #24
0
void ChangeIconDialog::InstIconListCtrl::UpdateItems()
{
	this->ClearAll();
	auto iconList = InstIconList::Instance();
	wxImageList *imgList = iconList->CreateImageList();
	AssignImageList(imgList, wxIMAGE_LIST_NORMAL);
	SetImageList(imgList, wxIMAGE_LIST_SMALL);
	
	const InstIconMap &iconMap = iconList->GetIconMap();
	int i = 0;
	for (InstIconMap::const_iterator iter = iconMap.begin(); iter != iconMap.end(); ++iter)
	{
		wxString key = iter->first;
		auto & icon = iter->second;
		InsertItem(i, icon.m_name, i);
		SetItemPtrData(i, (wxUIntPtr) &icon);
		i++;
	}
	SortItems(IconSortPredicate,0);
}
コード例 #25
0
ファイル: console.cpp プロジェクト: conradstorz/silverjuke
SjLogListCtrl::SjLogListCtrl(SjLogGui* logGui, wxWindow* parent, wxWindowID id, long aIndex)
	: wxListCtrl(parent, id, wxDefaultPosition, wxSize(600, 160), wxLC_REPORT | wxLC_VIRTUAL /*| wxLC_NO_HEADER*/)
{
	m_logGui = logGui;

	// assign the imagelist
	wxImageList* imageList = new wxImageList(16, 16);
	imageList->Add( wxArtProvider::GetBitmap(wxART_ERROR,       wxART_MESSAGE_BOX, wxSize(16, 16)) );
	imageList->Add( wxArtProvider::GetBitmap(wxART_WARNING,     wxART_MESSAGE_BOX, wxSize(16, 16)) );
	imageList->Add( wxArtProvider::GetBitmap(wxART_INFORMATION, wxART_MESSAGE_BOX, wxSize(16, 16)) );
	AssignImageList(imageList, wxIMAGE_LIST_SMALL);

	// init control
	InsertColumn(0, _("Message"));
	InsertColumn(1, _("Scope"));
	InsertColumn(2, _("Time"));

	SetItemCount(logGui->m_aPacked.GetCount());

	ScrollDownTo(aIndex);
}
コード例 #26
0
ファイル: OutputTree.cpp プロジェクト: rockstorm101/GMAT
//------------------------------------------------------------------------------
void OutputTree::AddIcons()
{
   #ifdef DEBUG_ADD_ICONS
   MessageInterface::ShowMessage
      ("OutputTree::AddIcons() entered, GmatTree::OUTPUT_ICON_COUNT=%d\n",
       GmatTree::OUTPUT_ICON_COUNT);
   #endif
   
   int sizeW = 16;
   int sizeH = 16;
   
   wxImageList *images = new wxImageList ( sizeW, sizeH, true );
   wxBitmap* bitmaps[GmatTree::OUTPUT_ICON_COUNT];
   int index = 0;
   long bitmapType = wxBITMAP_TYPE_PNG;

   // Note:
   // Add icons by the order of enum ResourceIconType in GmatTreeItemData.hpp

   theGuiManager->LoadIcon("ClosedFolder", bitmapType, &bitmaps[index], ClosedFolder_xpm); 
   theGuiManager->LoadIcon("OpenFolder", bitmapType, &bitmaps[++index], OpenFolder_xpm);
   theGuiManager->LoadIcon("rt_ReportFile", bitmapType, &bitmaps[++index], rt_ReportFile_xpm);
   theGuiManager->LoadIcon("rt_EphemerisFile", bitmapType, &bitmaps[++index], rt_EphemerisFile_xpm);
   theGuiManager->LoadIcon("rt_OrbitView", bitmapType, &bitmaps[++index], rt_OrbitView_xpm);
   theGuiManager->LoadIcon("rt_GroundTrackPlot", bitmapType, &bitmaps[++index], rt_GroundTrackPlot_xpm);
   theGuiManager->LoadIcon("rt_XYPlot", bitmapType, &bitmaps[++index], rt_XYPlot_xpm);
   theGuiManager->LoadIcon("file", bitmapType, &bitmaps[++index], file_xpm);   
   theGuiManager->LoadIcon("rt_Default", bitmapType, &bitmaps[++index], rt_Default_xpm);
   
   // Let's always rescale all icons since size of icon look different on different platforms
   for ( size_t i = 0; i < WXSIZEOF(bitmaps); i++ )
      images->Add(bitmaps[i]->ConvertToImage().Rescale(sizeW, sizeH));
   
   AssignImageList(images);
   
   #ifdef DEBUG_ADD_ICONS
   MessageInterface::ShowMessage
      ("OutputTree::AddIcons() exiting, %d icons added\n", index + 1);
   #endif
}
コード例 #27
0
void PHPFileLayoutTree::Construct()
{
    // Sanity
    if(!m_editor || !m_manager) return;

    wxString text = m_editor->GetTextRange(0, m_editor->GetLength());
    PHPSourceFile source(text);
    source.SetParseFunctionBody(false);
    source.SetFilename(m_editor->GetFileName());
    source.Parse();

    DeleteAllItems();
    wxTreeItemId root = AddRoot(wxT("Root"));

    wxImageList* images = new wxImageList(16, 16, true);
    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/globals")));            // 0
    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/function_private")));   // 1
    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/function_protected"))); // 2
    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/function_public")));    // 3
    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/member_private")));     // 4
    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/member_protected")));   // 5
    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/member_public")));      // 6
    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/namespace")));          // 7
    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/class")));              // 8
    images->Add(m_manager->GetStdIcons()->LoadBitmap(wxT("cc/16/enumerator")));         // 9
    AssignImageList(images);

    // Build the tree view
    BuildTree(root, source.Namespace());

    if(HasChildren(GetRootItem())) {
        wxTreeItemIdValue cookie;
        wxTreeItemId child = GetFirstChild(GetRootItem(), cookie);
        if(child.IsOk()) {
            SelectItem(child);
            ScrollTo(child);
        }
        ExpandAll();
    }
}
コード例 #28
0
ファイル: lst_custom.cpp プロジェクト: JohnnyonFlame/odamex
// Add any additional bitmaps/icons to the internal image list
int wxAdvancedListCtrl::AddImageSmall(wxImage Image)
{
    if (GetImageList(wxIMAGE_LIST_SMALL) == NULL)
    {
        wxImageList *ImageList = new wxImageList(16, 16, true);
        AssignImageList(ImageList, wxIMAGE_LIST_SMALL);
        
        wxBitmap sort_up(16, 16), sort_down(16, 16);
        wxColour Mask = wxColour(255,255,255);
        
        // Draw sort arrows using the native renderer
        {
            wxMemoryDC renderer_dc;

             // sort arrow up
            renderer_dc.SelectObject(sort_up);
            renderer_dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(Mask, wxSOLID));
            renderer_dc.Clear();
            wxRendererNative::Get().DrawHeaderButtonContents(this, renderer_dc, wxRect(0, 0, 16, 16), 0, wxHDR_SORT_ICON_UP);

             // sort arrow down
            renderer_dc.SelectObject(sort_down);
            renderer_dc.SetBackground(*wxTheBrushList->FindOrCreateBrush(Mask, wxSOLID));
            renderer_dc.Clear();
            wxRendererNative::Get().DrawHeaderButtonContents(this, renderer_dc, wxRect(0, 0, 16, 16), 0, wxHDR_SORT_ICON_DOWN);
        }

        // Add our sort icons to the image list
        ImageList_SortArrowDown = GetImageList(wxIMAGE_LIST_SMALL)->Add(sort_down, Mask);
        ImageList_SortArrowUp = GetImageList(wxIMAGE_LIST_SMALL)->Add(sort_up, Mask);
    }
    
    if (Image.IsOk())
    {
        return GetImageList(wxIMAGE_LIST_SMALL)->Add(Image);
    }
    
    return -1;
}
コード例 #29
0
ファイル: DatabaseDlg.cpp プロジェクト: takashi310/VVD_Viewer
DBTreeCtrl::DBTreeCtrl(
		wxWindow* frame,
		wxWindow* parent,
		wxWindowID id,
		const wxPoint& pos,
		const wxSize& size,
		long style) :
	wxTreeCtrl(parent, id, pos, size, style),
	m_frame(frame)
{
	wxImageList *images = new wxImageList(24, 24, true);
	wxIcon icons[3];
	icons[0] = wxIcon(cube_xpm);
	icons[1] = wxIcon(folder_xpm);
	icons[2] = wxIcon(database_xpm);
	images->Add(icons[0]);
	images->Add(icons[1]);
	images->Add(icons[2]);
	AssignImageList(images);
	SetDoubleBuffered(true); 

//	ExpandAll();
//	ScrollTo(item);
}
コード例 #30
0
ファイル: edlistctrl.cpp プロジェクト: myodoo/poedit
PoeditListCtrl::PoeditListCtrl(wxWindow *parent,
               wxWindowID id,
               const wxPoint &pos,
               const wxSize &size,
               long style,
               bool dispIDs,
               const wxValidator& validator,
               const wxString &name)
     : wxListView(parent, id, pos, size, style | wxLC_VIRTUAL, validator, name)
{
    m_catalog = NULL;
    m_displayIDs = dispIDs;

    m_isRTL = false;
    m_appIsRTL = (wxTheApp->GetLayoutDirection() == wxLayout_RightToLeft);

    sortOrder = SortOrder::Default();

    CreateColumns();

    int i;
    wxImageList *list = new wxImageList(16, 16);

    // IMG_NOTHING:
    list->Add(wxArtProvider::GetBitmap("poedit-status-nothing"));

    // IMG_AUTOMATIC:
    list->Add(wxArtProvider::GetBitmap("poedit-status-automatic"));
    // IMG_COMMENT:
    list->Add(wxArtProvider::GetBitmap("poedit-status-comment"));
    // IMG_AUTOMATIC | IMG_COMMENT:
    list->Add(MergeBitmaps(wxArtProvider::GetBitmap("poedit-status-automatic"),
                           wxArtProvider::GetBitmap("poedit-status-comment")));

    // IMG_MODIFIED
    list->Add(wxArtProvider::GetBitmap("poedit-status-modified"));

    // IMG_MODIFIED variations:
    for (i = 1; i < IMG_MODIFIED; i++)
    {
        list->Add(MergeBitmaps(BitmapFromList(list, i),
                               wxArtProvider::GetBitmap("poedit-status-modified")));
    }

    // BK_XX variations:
    for (int bk = 0; bk < 10; bk++)
    {
        for(i = 0; i <= (IMG_AUTOMATIC|IMG_COMMENT|IMG_MODIFIED); i++)
        {
            wxBitmap bmp = BitmapFromList(list, i);
            list->Add(AddDigit(bk, 0, 0, bmp));
        }
    }

    AssignImageList(list, wxIMAGE_LIST_SMALL);

    // configure items colors & fonts:

    wxVisualAttributes visual = GetDefaultAttributes();
    wxColour shaded = visual.colBg;

#ifdef __WXMSW__
    // On Windows 7, shaded list items make it impossible to see the selection,
    // so use different color for it (see bug #336).
    int verMaj, verMin;
    wxGetOsVersion(&verMaj, &verMin);
    if ( verMaj > 6 || (verMaj == 6 && verMin >= 1) )
    {
        shaded.Set(int(0.99 * shaded.Red()),
                   int(0.99 * shaded.Green()),
                   shaded.Blue());
    }
    else
#endif // __WXMSW__
#ifdef __WXOSX__
    if ( shaded == *wxWHITE )
    {
        // use standard shaded color from finder/databrowser:
        shaded.Set("#f0f5fd");
    }
    else
#endif // __WXOSX__
    {
        shaded.Set(int(DARKEN_FACTOR * shaded.Red()),
                   int(DARKEN_FACTOR * shaded.Green()),
                   int(DARKEN_FACTOR * shaded.Blue()));
    }

    m_attrNormal[1].SetBackgroundColour(shaded);
    m_attrUntranslated[1].SetBackgroundColour(shaded);
    m_attrFuzzy[1].SetBackgroundColour(shaded);
    m_attrInvalid[1].SetBackgroundColour(shaded);

    // FIXME: make this user-configurable
    if ( IsAlmostWhite(visual.colBg) )
    {
        m_attrUntranslated[0].SetTextColour(gs_UntranslatedForWhite);
        m_attrUntranslated[1].SetTextColour(gs_UntranslatedForWhite);
        m_attrFuzzy[0].SetTextColour(gs_FuzzyForWhite);
        m_attrFuzzy[1].SetTextColour(gs_FuzzyForWhite);
    }
    else if ( IsAlmostBlack(visual.colBg) )
    {
        m_attrUntranslated[0].SetTextColour(gs_UntranslatedForBlack);
        m_attrUntranslated[1].SetTextColour(gs_UntranslatedForBlack);
        m_attrFuzzy[0].SetTextColour(gs_FuzzyForBlack);
        m_attrFuzzy[1].SetTextColour(gs_FuzzyForBlack);
    }
    // else: we don't know if the default colors would be well-visible on
    //       user's background color, so play it safe and don't highlight
    //       anything

    // FIXME: todo; use appropriate font for fuzzy/trans/untrans
    m_attrInvalid[0].SetBackgroundColour(gs_ErrorColor);
    m_attrInvalid[1].SetBackgroundColour(gs_ErrorColor);

    // Use gray for IDs
    if ( IsAlmostBlack(visual.colFg) )
        m_attrId.SetTextColour(wxColour("#A1A1A1"));

    SetCustomFont(wxNullFont);
}