Ejemplo n.º 1
0
CAllStockWidget::CAllStockWidget( CBaseWidget* parent /*= 0*/, RWidgetType type /*= WidgetAllStock*/ )
    : CBaseWidget(parent,type)
    , m_iItemWidth(1)
    , m_iItemHeight(2)
    , m_crCircle(Min5)
    , m_stOrder(Qt::DescendingOrder)
{
    setMouseTracking(true);

    setSortType(SortByIncrease);
    updateStockDatas();
}
Ejemplo n.º 2
0
void KateFileList::readConfig( KConfig *config, const QString &group )
{
  QString oldgroup = config->group();
  config->setGroup( group );

  setSortType( config->readNumEntry( "Sort Type", sortByID ) );
  m_viewShade = config->readColorEntry( "View Shade", &m_viewShade );
  m_editShade = config->readColorEntry( "Edit Shade", &m_editShade );
  m_enableBgShading = config->readBoolEntry( "Shading Enabled", &m_enableBgShading );

  sortAction->setCurrentItem( sortType() );

  config->setGroup( oldgroup );
}
Ejemplo n.º 3
0
/* MapTextureBrowser::MapTextureBrowser
 * MapTextureBrowser class constructor
 *******************************************************************/
MapTextureBrowser::MapTextureBrowser(wxWindow* parent, int type, string texture, SLADEMap* map) : BrowserWindow(parent)
{
	// Init variables
	this->type = type;
	this->map = map;
	this->truncate_names = true;

	// Init sorting
	addSortType("Usage Count");
	setSortType(map_tex_sort);

	// Set window title
	SetTitle("Browse Map Textures");

	// Textures
	if (type == 0 || theGameConfiguration->mixTexFlats())
	{
		addGlobalItem(new MapTexBrowserItem("-", 0, 0));

		vector<map_texinfo_t>& textures = theMapEditor->textureManager().getAllTexturesInfo();
		for (unsigned a = 0; a < textures.size(); a++)
		{
			// Add browser item
			addItem(new MapTexBrowserItem(textures[a].name, 0, textures[a].index),
				determineTexturePath(textures[a].archive, textures[a].category, "Textures", textures[a].path));
		}
	}

	// Flats
	if (type == 1 || theGameConfiguration->mixTexFlats())
	{
		vector<map_texinfo_t>& flats = theMapEditor->textureManager().getAllFlatsInfo();
		for (unsigned a = 0; a < flats.size(); a++)
		{
			// Determine tree path
			string path = determineTexturePath(flats[a].archive, flats[a].category, "Flats", flats[a].path);

			// Add browser item
			if (flats[a].category == MapTextureManager::TC_TEXTURES)
				addItem(new MapTexBrowserItem(flats[a].name, 0, flats[a].index), path);
			else
				addItem(new MapTexBrowserItem(flats[a].name, 1, flats[a].index), path);
		}
	}

	populateItemTree(false);

	// Select initial texture (if any)
	selectItem(texture);
}
Ejemplo n.º 4
0
void XFE_AddrBookView::clickHeader(const OutlineButtonFuncData *data)
{
  int column = data->column; 
  int invalid = True;
#if defined(USE_ABCOM)
  switch (column) {
    case OUTLINER_COLUMN_TYPE:
      setSortType(AB_attribEntryType);
      break;

    case OUTLINER_COLUMN_NAME:
      setSortType(AB_attribFullName);
      break;

    case OUTLINER_COLUMN_NICKNAME:
      setSortType(AB_attribNickName);
      break;

    case OUTLINER_COLUMN_EMAIL:
      setSortType(AB_attribEmailAddress);
      break;

    case OUTLINER_COLUMN_COMPANY:
      setSortType(AB_attribCompanyName);
      break;

    case OUTLINER_COLUMN_LOCALITY:
      setSortType(AB_attribLocality);
      break;
    default:
      invalid = False;
    }/* switch() */
#else
  switch (column) {
    case OUTLINER_COLUMN_TYPE:
      setSortType(AB_SortByTypeCmd);
      break;

    case OUTLINER_COLUMN_NAME:
      setSortType(AB_SortByFullNameCmd);
      break;

    case OUTLINER_COLUMN_NICKNAME:
      setSortType(AB_SortByNickname);
      break;

    case OUTLINER_COLUMN_EMAIL:
      setSortType(AB_SortByEmailAddress);
      break;

    case OUTLINER_COLUMN_COMPANY:
      setSortType(AB_SortByCompanyName);
      break;

    case OUTLINER_COLUMN_LOCALITY:
      setSortType(AB_SortByLocality);
      break;
    default:
      invalid = False;
    }/* switch() */
#endif /* USE_ABCOM */

  if (invalid)
    m_outliner->invalidate();
}
Ejemplo n.º 5
0
MapTextureBrowser::MapTextureBrowser(wxWindow* parent, int type, string texture) : BrowserWindow(parent)
{
	// Init variables
	this->type = type;
	setSortType(1);

	// Set window title
	SetTitle("Browse Map Textures");

	// Textures
	if (type == 0 || theGameConfiguration->mixTexFlats())
	{
		// No texture '-'
		addItem(new MapTexBrowserItem("-", 0, 0), "Textures");

		// Composite textures
		vector<TextureResource::tex_res_t> textures;
		theResourceManager->getAllTextures(textures, NULL);
		for (unsigned a = 0; a < textures.size(); a++)
			addItem(new MapTexBrowserItem(textures[a].tex->getName(), 0, textures[a].tex->getIndex()+1), "Textures/TEXTUREx");

		// Texture namespace patches (TX_)
		if (theGameConfiguration->txTextures())
		{
			vector<ArchiveEntry*> patches;
			theResourceManager->getAllPatchEntries(patches, NULL);
			for (unsigned a = 0; a < patches.size(); a++)
			{
				if (patches[a]->isInNamespace("textures"))
				{
					// Determine texture path if it's in a pk3
					string path = patches[a]->getPath();
					if (path.StartsWith("/textures/"))
						path.Remove(0, 9);
					else
						path = "";

					addItem(new MapTexBrowserItem(patches[a]->getName(true), 0, a), "Textures/Textures (TX)" + path);
				}
			}
		}
	}

	// Flats
	if (type == 1 || theGameConfiguration->mixTexFlats())
	{
		vector<ArchiveEntry*> flats;
		theResourceManager->getAllFlatEntries(flats, NULL);
		for (unsigned a = 0; a < flats.size(); a++)
		{
			ArchiveEntry* entry = flats[a];

			// Determine flat path if it's in a pk3
			string path = entry->getPath();
			if (path.StartsWith("/flats/"))
				path.Remove(0, 6);
			else
				path = "";

			addItem(new MapTexBrowserItem(entry->getName(true), 1, entry->getParentDir()->entryIndex(entry)), "Flats" + path);
		}
	}

	populateItemTree();

	// Select initial texture (if any)
	if (!texture.IsEmpty())
		selectItem(texture);
}