Code/Resource
Windows Develop
Linux-Unix program
Internet-Socket-Network
Web Server
Browser Client
Ftp Server
Ftp Client
Browser Plugins
Proxy Server
Email Server
Email Client
WEB Mail
Firewall-Security
Telnet Server
Telnet Client
ICQ-IM-Chat
Search Engine
Sniffer Package capture
Remote Control
xml-soap-webservice
P2P
WEB(ASP,PHP,...)
TCP/IP Stack
SNMP
Grid Computing
SilverLight
DNS
Cluster Service
Network Security
Communication-Mobile
Game Program
Editor
Multimedia program
Graph program
Compiler program
Compress-Decompress algrithms
Crypt_Decrypt algrithms
Mathimatics-Numerical algorithms
MultiLanguage
Disk/Storage
Java Develop
assembly language
Applications
Other systems
Database system
Embeded-SCM Develop
FlashMX/Flex
source in ebook
Delphi VCL
OS Develop
MiddleWare
MPI
MacOS develop
LabView
ELanguage
Software/Tools
E-Books
Artical/Document
palette.cpp
Package: LeftToolbar.rar [view]
Upload User: dfguandao
Upload Date: 2020-06-07
Package Size: 23k
Code Size: 1k
Category:
ToolBar
Development Platform:
Visual C++
- #include "stdafx.h"
- #include "ctrlbars.h"
- #include "palette.h"
- #ifdef _DEBUG
- #undef THIS_FILE
- static char BASED_CODE THIS_FILE[] = __FILE__;
- #endif
- /////////////////////////////////////////////////////////////////////////////
- // CPaletteBar
- BEGIN_MESSAGE_MAP(CPaletteBar, CToolBar)
- //{{AFX_MSG_MAP(CPaletteBar)
- //}}AFX_MSG_MAP
- END_MESSAGE_MAP()
- /////////////////////////////////////////////////////////////////////////////
- // CPaletteBar construction/destruction
- CPaletteBar::CPaletteBar()
- {
- m_nColumns = 2;
- m_cxLeftBorder = 5;
- m_cyTopBorder = 5;
- m_cxRightBorder = 5;
- m_cyBottomBorder = 5;
- }
- CPaletteBar::~CPaletteBar()
- {
- }
- /////////////////////////////////////////////////////////////////////////////
- // CPaletteBar diagnostics
- #ifdef _DEBUG
- void CPaletteBar::AssertValid() const
- {
- CToolBar::AssertValid();
- }
- void CPaletteBar::Dump(CDumpContext& dc) const
- {
- CToolBar::Dump(dc);
- }
- #endif //_DEBUG
- /////////////////////////////////////////////////////////////////////////////
- // CPaletteBar message handlers
- void CPaletteBar::SetColumns(UINT nColumns)
- {
- m_nColumns = nColumns;
- int nCount = GetToolBarCtrl().GetButtonCount();
- for (int i = 0; i < nCount; i++)
- {
- UINT nStyle = GetButtonStyle(i);
- BOOL bWrap = (((i + 1) % nColumns) == 0);
- if (bWrap)
- nStyle |= TBBS_WRAPPED;
- else
- nStyle &= ~TBBS_WRAPPED;
- SetButtonStyle(i, nStyle);
- }
- Invalidate();
- GetParentFrame()->RecalcLayout();
- }