当前位置: 首页>>代码示例>>C++>>正文


C++ SetColumnWidth函数代码示例

本文整理汇总了C++中SetColumnWidth函数的典型用法代码示例。如果您正苦于以下问题:C++ SetColumnWidth函数的具体用法?C++ SetColumnWidth怎么用?C++ SetColumnWidth使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了SetColumnWidth函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: RGB

void CVariablesGrid::Init()
{
	LuaState* state = theApp.GetDocument()->GetState();
	
	m_buttonDatabase.SetGrid(this);
	m_imageList.Create(MAKEINTRESOURCE(IDB_FOLDERS), 16, 1, RGB(255,255,255));
    SetImageList(&m_imageList);

	SetColumnCount(2);
	SetDefCellHeight(ROW_HEIGHT);
	SetRowCount(0);
	SetColumnWidth(NAME_COL, NAME_WIDTH);
	SetColumnWidth(DATA_COL, DATA_WIDTH);

	CString fontName = "Arial";
	
	LOGFONT logFont;
	memset(&logFont, 0, sizeof(LOGFONT));
	logFont.lfCharSet = DEFAULT_CHARSET;
	logFont.lfWeight = 700;
	logFont.lfHeight = 80;
	lstrcpyn(logFont.lfFaceName, fontName, fontName.GetLength());

	m_titleFont.CreatePointFontIndirect(&logFont);
	m_dataFont.CreatePointFont(80, fontName);
}
开发者ID:ClowReed32,项目名称:Cthugha-Engine-Demos,代码行数:26,代码来源:VariablesGrid.cpp

示例2: wxListCtrl

WBinaryPageList::WBinaryPageList(class WBinaryPage* parent, wxWindowID id)
    : wxListCtrl(parent, id, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxLC_VIRTUAL | wxLC_SINGLE_SEL),
      binpage(*parent)
{
    wxFont font(10, wxMODERN, wxNORMAL, wxNORMAL);
    SetFont(font);

    unsigned int size = binpage.bindata.GetDataLen();

    SetItemCount((size / 16) + ((size % 16) != 0));

    InsertColumn(0, _T("Offset"), wxLIST_FORMAT_RIGHT, 32);
    InsertColumn(1, _T("Hexadecimal"), wxLIST_FORMAT_LEFT, 400);
    InsertColumn(2, _T("ASCII"), wxLIST_FORMAT_LEFT);

    wxWindowDC dc(this);
    wxCoord textwidth, textheight;

    dc.SetFont(font);

    dc.GetTextExtent(_T("000000000"), &textwidth, &textheight);
    SetColumnWidth(0, textwidth);

    dc.GetTextExtent(_T("00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  "), &textwidth, &textheight);
    SetColumnWidth(1, textwidth);

    dc.GetTextExtent(_T("0000000000000000  "), &textwidth, &textheight);
    SetColumnWidth(2, textwidth);

    SetItemCount((size / 16) + ((size % 16) != 0));
}
开发者ID:bingmann,项目名称:cryptote,代码行数:31,代码来源:wbinpage.cpp

示例3: OnSize

	// WM_SIZE handler.
	virtual LRESULT OnSize( UINT nSizeType, int nWidth, int nHeight )
	{
		SetColumnWidth( 0, nWidth / 2 );
		SetColumnWidth( 1, LVSCW_AUTOSIZE_USEHEADER );
		SetColumnWidth( 2, LVSCW_AUTOSIZE_USEHEADER );
		return ClsListView::OnSize( nSizeType, nWidth, nHeight );
	}
开发者ID:x2on,项目名称:NiLogViewer,代码行数:8,代码来源:Main.cpp

示例4: rc

void CGameListCtrl::AutomaticColumnWidth()
{
	wxRect rc(GetClientRect());

	if (GetColumnCount() == 1)
		SetColumnWidth(0, rc.GetWidth());
	else if (GetColumnCount() > 4)
	{
		int resizable = rc.GetWidth() - (
			GetColumnWidth(COLUMN_BANNER)
			+ GetColumnWidth(COLUMN_COUNTRY)
			+ GetColumnWidth(COLUMN_SIZE)
			+ GetColumnWidth(COLUMN_EMULATION_STATE)
			+ GetColumnWidth(COLUMN_PLATFORM));

		// We hide the Notes column if the window is too small
		if (resizable > 400)
		{
			SetColumnWidth(COLUMN_TITLE, resizable / 2);
			SetColumnWidth(COLUMN_NOTES, resizable / 2);
		}
		else
		{
			SetColumnWidth(COLUMN_TITLE, resizable);
			SetColumnWidth(COLUMN_NOTES, 0);
		}
	}
}
开发者ID:Everscent,项目名称:dolphin-emu,代码行数:28,代码来源:GameListCtrl.cpp

示例5: wxListCtrl

HOTKEY_LIST_CTRL::HOTKEY_LIST_CTRL( wxWindow *aParent, struct EDA_HOTKEY_CONFIG* aSection ) :
    wxListCtrl( aParent, wxID_ANY, wxDefaultPosition,
                wxDefaultSize, wxLC_HRULES|wxLC_REPORT|wxLC_SINGLE_SEL|wxLC_VIRTUAL )
{
    m_sectionTag = aSection->m_SectionTag;
    m_curEditingRow = -1;

    InsertColumn( 0, _( "Command" ) );
    InsertColumn( 1, _( "Hotkey" ) );

    // Add a dummy hotkey_spec which is a header before each hotkey list
    EDA_HOTKEY** hotkey_descr_list;

    // Add a copy of hotkeys to our list
    for( hotkey_descr_list = aSection->m_HK_InfoList; *hotkey_descr_list; hotkey_descr_list++ )
    {
        EDA_HOTKEY* hotkey_descr = *hotkey_descr_list;
        m_hotkeys.push_back( new EDA_HOTKEY( hotkey_descr ) );
    }

    // Set item count to hotkey size, this gets it to autoload the entries
    SetItemCount( m_hotkeys.size() );

    SetColumnWidth( 0, wxLIST_AUTOSIZE );
    SetColumnWidth( 1, wxLIST_AUTOSIZE );

    Bind( wxEVT_CHAR, &HOTKEY_LIST_CTRL::OnChar, this );
    Bind( wxEVT_LIST_ITEM_SELECTED, &HOTKEY_LIST_CTRL::OnListItemSelected, this );
    Bind( wxEVT_SIZE, &HOTKEY_LIST_CTRL::OnSize, this );
}
开发者ID:Elphel,项目名称:kicad-source-mirror,代码行数:30,代码来源:dialog_hotkeys_editor.cpp

示例6: wxSortedListCtrl

ThreadList::ThreadList(wxWindow *parent, const wxPoint& pos,
						 const wxSize& size, wxButton *_ok_button, wxButton *_all_button)
						 :	wxSortedListCtrl(parent, THREADS_LIST, pos, size, wxLC_REPORT),
						 timer(this, THREADS_LIST_TIMER),
						 ok_button(_ok_button), all_button(_all_button)
{
	InitSort();

	wxListItem itemCol;
	itemCol.m_mask = wxLIST_MASK_TEXT/* | wxLIST_MASK_IMAGE*/;
	itemCol.m_text = _T("Thread");
	itemCol.m_image = -1;
	InsertColumn(COL_ID, itemCol);
	itemCol.m_text = _T("Location");
	InsertColumn(COL_LOCATION, itemCol);
	itemCol.m_text = _T("Thread Usage");
	InsertColumn(COL_CPUUSAGE, itemCol);

	SetColumnWidth(COL_ID, 50);
	SetColumnWidth(COL_LOCATION, 200);
	SetColumnWidth(COL_CPUUSAGE, 120);

	sort_column = COL_CPUUSAGE;
	sort_dir = SORT_DOWN;
	SetSortImage(sort_column, sort_dir); 

	process_handle = NULL;
	syminfo = NULL;

	lastTime = wxGetLocalTimeMillis();
	updateThreads(NULL, NULL);
	timer.Start(UPDATE_DELAY);
}
开发者ID:mhoffesommer,项目名称:Very-Sleepy,代码行数:33,代码来源:threadlist.cpp

示例7: SetColumnWidth

void HistList::UpdateColumns()
{
    SetColumnWidth(0, wxLIST_AUTOSIZE);
    SetColumnWidth(1, wxLIST_AUTOSIZE);
    SetColumnWidth(2, wxLIST_AUTOSIZE);
    Layout();
}
开发者ID:ClaudioVZ,项目名称:crengine,代码行数:7,代码来源:histlist.cpp

示例8: SetRedraw

/*
 *******************************************************************
 * Function: void CGBLListCtrl::AutoSizeColumns(int columnNumber) 
 *
 * Description : Autio sizes the columns
 *		
 * Paramters : 
 *              int columnNumber - column to resize, if this is -1 all columns
 *              are resized
 *   
 * Returns : 
 *              pointer to the toolbar
 *   
 *******************************************************************
 */
void CGBLListCtrl::AutoSizeColumns(int columnIndex /*=-1*/) 
{
     SetRedraw(false);
     int minColumn;
     int maxColumn;

     if(columnIndex < 0 )
     {
        minColumn = 0;
        maxColumn = GetColumnCount()-1;
     }
     else
     {
        minColumn = minColumn = columnIndex;
     }

     for (int i = minColumn; i <= maxColumn; i++) 
     {
          SetColumnWidth(i,LVSCW_AUTOSIZE);
          int columnWidth = GetColumnWidth(i);
          SetColumnWidth(i,LVSCW_AUTOSIZE_USEHEADER);
          int headerWidth = GetColumnWidth(i);
          int width = max(15,max(columnWidth,headerWidth));
          SetColumnWidth(i,width);
     }
     SetRedraw(true);
}
开发者ID:gbaumgart,项目名称:GBL_Backup,代码行数:42,代码来源:GBLListCtrl.cpp

示例9: GetSelection

void LIBRARY_LISTBOX::SetLibraryList( const wxArrayString& aList )
{
    int oldSelection = GetSelection();

    m_libraryList = aList;

    SetItemCount( m_libraryList.GetCount() );

    if(  GetCount() == 0 || oldSelection < 0 || oldSelection >= GetCount() )
        SetSelection( 0, true );

    if( m_libraryList.Count() )
    {
        RefreshItems( 0L, m_libraryList.Count()-1 );

#if defined (__WXGTK__ ) && wxMINOR_VERSION == 8
        // @bug On GTK and wxWidgets 2.8.x, this will assert in debug builds because the
        //      column parameter is -1.  This was the only way to prevent GTK3 from
        //      ellipsizing long strings down to a few characters.  It still doesn't set
        //      the scroll bars correctly (too short) but it's better than any of the
        //      other alternatives.  If someone knows how to fix this, please do.
        SetColumnWidth( -1, wxLIST_AUTOSIZE );
#else
        SetColumnWidth( 0, wxLIST_AUTOSIZE );
#endif
    }
}
开发者ID:manasdas17,项目名称:kicad-source-mirror,代码行数:27,代码来源:class_library_listbox.cpp

示例10: wxString

void console::TELLFuncList::addFunc(wxString name, void* arguments)
{
   ArgList* arglist = static_cast<ArgList*>(arguments);
   wxListItem row;
   row.SetMask(wxLIST_MASK_DATA | wxLIST_MASK_TEXT);
   row.SetId(GetItemCount());
   row.SetData(GetItemCount());
   row.SetText( wxString((arglist->front()).c_str(), wxConvUTF8));arglist->pop_front();
   InsertItem(row);
   SetColumnWidth(0, wxLIST_AUTOSIZE);
   //
   row.SetColumn(1);
   row.SetMask(wxLIST_MASK_TEXT);
   row.SetText(name.c_str());
   SetItem(row);
   SetColumnWidth(1, wxLIST_AUTOSIZE);
   //
   wxString strlist(wxT("( "));
   while (!arglist->empty())
   {
      strlist << wxString(arglist->front().c_str(), wxConvUTF8);arglist->pop_front();
      if (arglist->size()) strlist << wxT(" , ");
   }
   delete arglist;
   strlist << wxT(" )");
   //
   row.SetColumn(2);
   row.SetMask(wxLIST_MASK_TEXT);
   row.SetText(strlist);
   SetItem(row);
   SetColumnWidth(2, wxLIST_AUTOSIZE);
}
开发者ID:BackupTheBerlios,项目名称:toped-svn,代码行数:32,代码来源:outbox.cpp

示例11: InsertItem

void console::TELLFuncList::addFunc(wxString name, void* arguments)
{
   ArgList* arglist = static_cast<ArgList*>(arguments);
   wxListItem row;
   row.SetMask(wxLIST_MASK_DATA | wxLIST_MASK_TEXT);
   row.SetId(GetItemCount());
   row.SetData(GetItemCount());
   row.SetText((arglist->front()).c_str());arglist->pop_front();
   long inum = InsertItem(row);
   SetColumnWidth(0, wxLIST_AUTOSIZE);
   //
   row.SetColumn(1);
   row.SetMask(wxLIST_MASK_TEXT);
   row.SetText(name.c_str());
   SetItem(row);
   SetColumnWidth(1, wxLIST_AUTOSIZE);
   //
   std::string strlist("( ");
   while (!arglist->empty())
   {
      strlist += arglist->front();arglist->pop_front();
      if (arglist->size()) strlist += " , ";
   }
   strlist += " )";
   //
   row.SetColumn(2);
   row.SetMask(wxLIST_MASK_TEXT);
   row.SetText(strlist.c_str());
   SetItem(row);
   SetColumnWidth(2, wxLIST_AUTOSIZE);
}
开发者ID:BackupTheBerlios,项目名称:toped-svn,代码行数:31,代码来源:outbox.cpp

示例12: SetExtendedListViewStyle

void CClipSpyListCtrl::Init()
{
    SetExtendedListViewStyle ( LVS_EX_FULLROWSELECT );

    InsertColumn ( 0, _T("Format"), LVCFMT_LEFT, 0, 0 );
    InsertColumn ( 1, _T("Data size"), LVCFMT_LEFT, 0, 1 );

    SetColumnWidth ( 0, LVSCW_AUTOSIZE_USEHEADER );
    SetColumnWidth ( 1, LVSCW_AUTOSIZE_USEHEADER );

    // Register this window as a clipboard viewer.  This makes us get the
    // WM_DRAWCLIPBOARD and WM_CHANGECBCHAIN messages.  The 
    // m_bCallingSetClipboardViewer is necessary because SetClipboardViewer()
    // sends us a WM_DRAWCLIPBOARD but we must not process it.  See
    // OnDrawClipboard() for more details.
    m_bCallingSetClipboardViewer = true;
    m_hwndNextClipboardViewer = SetClipboardViewer();
    m_bCallingSetClipboardViewer = false;

    // Init our drop target object
//     m_pDropTarget = CDropTargetImpl<CClipSpyListCtrl>::CreateMe ( this );
// 
//     if ( m_pDropTarget )
//         m_pDropTarget->InitializeDT();

    // Read the stuff on the clipboard, if there is any.
    ReadClipboard();
}
开发者ID:slb1988,项目名称:PatentSearcher,代码行数:28,代码来源:ClipSpyListCtrl.cpp

示例13: GetItemText

void HOTKEY_LIST_CTRL::recalculateColumns()
{
    float totalLength = 0;
    float scale = 0;

    // Find max character length of first column
    int maxInfoMsgLength = 0;

    for( int i = 0; i < GetItemCount(); i++ )
    {
        int length = GetItemText( i, 0 ).Length();

        if( length > maxInfoMsgLength )
            maxInfoMsgLength = length;
    }

    // Find max character length of second column
    int maxKeyCodeLength = 0;

    for( int i = 0; i < GetItemCount(); i++ )
    {
        int length = GetItemText( i, 1 ).Length();
        if( length > maxKeyCodeLength )
            maxKeyCodeLength = length;
    }

    // Use the lengths of column texts to create a scale of the max list width
    // to set the column widths
    totalLength = maxInfoMsgLength + maxKeyCodeLength;

    scale = (float) GetClientSize().x / totalLength;

    SetColumnWidth( 0, int( maxInfoMsgLength*scale ) - 2 );
    SetColumnWidth( 1, int( maxKeyCodeLength*scale ) );
}
开发者ID:Elphel,项目名称:kicad-source-mirror,代码行数:35,代码来源:dialog_hotkeys_editor.cpp

示例14: wxListCtrl

//==============================================================================
browsers::topedlay_list::topedlay_list(wxWindow *parent, wxWindowID id,
   const wxPoint& pos, const wxSize& size, long style) : 
                                       wxListCtrl(parent, id, pos, size, style) {
   InsertColumn(0, wxT("  No    "));
   InsertColumn(1, wxT("     Name     "));
   InsertColumn(2, wxT(" S "));
   SetColumnWidth(0, wxLIST_AUTOSIZE_USEHEADER);
   SetColumnWidth(1, wxLIST_AUTOSIZE_USEHEADER);
   SetColumnWidth(2, wxLIST_AUTOSIZE_USEHEADER);
   _imageList = DEBUG_NEW wxImageList(16, 16, TRUE);
#ifdef __WXMSW__
/*@TODO : Under windows - resource loading*/
//    m_imageListNormal->Add( wxIcon(_T("icon1"), wxBITMAP_TYPE_ICO_RESOURCE) );
//
#else
   //SGREM!!! Troubles with the gdb on Linux with threads!
   // I spent a night debugging a stupid mistake with traversing the tree
   // to realize finally that the gdb is doing some funny things when 
   // stepping over next two lines. The troble comes from wxIcon constructor, 
   // that internally is calling gdk_pixmap_create_from_xpm_d
    _imageList->Add( wxIcon( activelay ) );
    _imageList->Add( wxIcon( lock      ) );
#endif
//   SetBackgroundColour(wxColour("LIGHTGREY"));
   SetImageList(_imageList,wxIMAGE_LIST_SMALL);
   _llfont_normal.SetPointSize(9);
   _llfont_bold.SetPointSize(9);
   _llfont_bold.SetWeight(wxBOLD);
}
开发者ID:BackupTheBerlios,项目名称:toped-svn,代码行数:30,代码来源:browsers.cpp

示例15: SetColumnWidth

void CTDLFindTaskExpressionListCtrl::OnSize(UINT nType, int cx, int cy) 
{
	CInputListCtrl::OnSize(nType, cx, cy);
	
	// resize columns by proportion
	SetColumnWidth(ATTRIB, (int)(cx * COL_PROPORTIONS[ATTRIB]));
	SetColumnWidth(OPERATOR, (int)(cx * COL_PROPORTIONS[OPERATOR]));
	SetColumnWidth(VALUE, (int)(cx * COL_PROPORTIONS[VALUE]));
	SetColumnWidth(ANDOR, (int)(cx * COL_PROPORTIONS[ANDOR]));
}
开发者ID:Fox-Heracles,项目名称:TodoList,代码行数:10,代码来源:TDLFindTaskExpressionListCtrl.cpp


注:本文中的SetColumnWidth函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。