注册 登录
明经CAD社区 返回首页

风树的个人空间 http://www.mjtd.com/?408117 [收藏] [复制] [分享] [RSS]

日志

(源码)让刚接触lsp的人都能制作自己的工具箱

热度 6已有 2129 次阅读2013-11-18 22:00 |系统分类:应用| 工具箱, 源码

提供给和我当时做这个工具箱时一样的初学者,一些参考例子。

       说实在话,主体做得并不好有的地方可以简化的,但当时考虑尽可能使用一些没用过或不熟练的东西。程序是能正常正常运行的。

       这是提供给初学者参考的例子,有错的地方可以指出,但请认为不好的人也不要“喷”了。

       如果“喷”了,请提供更好的参考例子给我们学习一下,那更有意义,要不兄弟们鄙视你,这是我从小学思想品德课里学的。
       
       基本的控件框架从网上收集,对刷新,右拉控制条、控件特性等方面做了调整,并加入了一些用来传递信息的结构和接口(原作者不要见怪),并未在下面粘贴。
        如需要下面的代码及控件代码的.h和.cpp文件格式的请留下邮箱。
      ( vc我也不是很熟,我不知道怎么分离其中的资源文件,提供了.h和.cpp文件后还是不能马上使用的,但只需少量的修改。
           对打开对话框提取出来的路径进行字符串处理,提取相关的信息,网上有很多的例子,自己替换相应函数就行)
      

 粘贴如下:
//头文件
#pragma once
#ifndef _cad_tool_simple_Ctrl_H
#define _cad_tool_simple_Ctrl_H
#include "..\..\Resource1.h"
#include "..\..\resource1.h"
#include "..\系统头文件\list_head.h"
#include "..\文件系统\XTCOW_File\XTCOW_File.h"
#include "..\..\编程2013\vc控件\组合菜单(修改)\GroupFrame.h"
using namespace xtcow;
namespace xtcow
{
#define control_message_for_GroupFrame_TEMPLATE_ template<typename T  >
#define control_message_for_GroupFrame_QUAL_ control_message_for_GroupFrame< T >
template<typename T >
class control_message_for_GroupFrame
{
public:
std::set<std::wstring > included_file;
//肯定加载项
std::set<std::wstring > sys_loading;
//固定加载项
std::vector<std::wstring > fixed_loading;
//保存cad_tool_simple对象当前已经加载的MFC_GroupMenu对象指针
std::vector<MFC_GroupMenu *> GroupMenu;
//保存当前已经加载的MFC_GroupMenu对象的GroupMenu_window_Info信息
std::vector<Window_Info> store_for_GroupMenu_window_Info;
//通过store_for_GroupMenu_window_Info和store_for_GroupMenu_subitem_Info能重构MFC_GroupFrame对象
std::map<UINT,std::vector< std::wstring > >   message_to_message_data;
public:
control_message_for_GroupFrame(){bind_data=0;};
control_message_for_GroupFrame(T *bind_data_){bind_data=bind_data_;};
~control_message_for_GroupFrame(){};
public:
void bind(T *pt_bind_data){bind_data=pt_bind_data;};
void release_GroupMenu_res();
//不改变原来数据内容,只是返回一个带有必要构造数据,其他数据为空的control_message_for_GroupFrame对象
void load_for_restructured(std::wstring store_text);
void save_for_restructured(std::wstring store_text);
private:
T *bind_data;
//禁用复制构造函数
control_message_for_GroupFrame(const control_message_for_GroupFrame& C){};  
};

//实例计数结构
class struct_
{
public:
std::wstring type_name;
int state;//是否存在实例
struct_(std::wstring type_name_)
{
type_name=type_name_;
state=0;
};
~struct_(){};
public:
void add_one(){state++;};
void delete_one(){state--;};
bool operator==(const std::wstring &type_name_)
{
if(type_name!=type_name_)
return 0;
return 1;
}
};
//同一名字下的实例最多200条命令,最多4个不同名字的实例
#define IDC_rand 700
class cad_tool_simple : public CAdUiDialog  
{
public:
//用来记录已经生成的实例特性
class_attribute class_attribute_;
static std::vector<struct_ > type_name;
//每个实例记录对应的消息映射开始值
        int message_range;
control_message_for_GroupFrame< cad_tool_simple > control_message_for_GroupFrame_;
//显示大小相关部分
//记录屏幕分辨率
double y;//int 
double X;//int 
double proportion_y;
double proportion_x;
CFont*f;//字体
//mfc控件
CButton add_ming_ling_zhu; //按钮
CButton save_board;//按钮
CButton load_board;//按钮
CStatic black_board;

MFC_GroupMenu *m_GroupMenu;//组件1
MFC_GroupFrame *m_GroupFrame;//组件2
enum { IDD = IDD_cad_tool_simple };
public:
cad_tool_simple(std::wstring class_name_,CWnd* pParent =NULL);
~cad_tool_simple(void);
void Create_and_show (void);
public:
afx_msg LRESULT OnAcadKeepFocus (WPARAM, LPARAM);//固定(非模态对话框用)
private:
void load_GroupMenu_add_to_frame(void);
INT_PTR DoModal(){return 0;};
virtual BOOL OnInitDialog();
BOOL PreTranslateMessage(MSG* pMsg);
afx_msg void OnClose();
afx_msg void OnNcDestroy();
afx_msg void On_add_a_menu();
afx_msg void On_save_tool();
afx_msg void On_load_tool();
afx_msg void On_ming_ling(UINT nID);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg LRESULT OnHotKey(WPARAM wParam,LPARAM lParam);
afx_msg LRESULT OnGroupHeaderCRICKED(WPARAM wParam, LPARAM lParam);
//
DECLARE_MESSAGE_MAP()
bool hot_show;
protected:
virtual void DoDataExchange(CDataExchange* pDX);

};
}
#endif 

//实现文件

#include "stdafx.h"
#include "cad_tool_simple.h"
#include "..\cad2012+arx\转换\format_change\format_change.h "
#include "..\cad2012+arx\函数库\function_for_cad\function_for_cad.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
#include <atlbase.h>

using namespace xtcow;
namespace xtcow
{
//释放GroupMenu资源,清空对象内所有数据
control_message_for_GroupFrame_TEMPLATE_
void control_message_for_GroupFrame_QUAL_::release_GroupMenu_res()
{
for(int i=0;i!=GroupMenu.size();i++)
{
if(GroupMenu[i]!=0)delete GroupMenu[i];//菜单消失
}
GroupMenu.clear();
}
control_message_for_GroupFrame_TEMPLATE_
void control_message_for_GroupFrame_QUAL_::save_for_restructured(std::wstring store_text)
{
std::wofstream file_in;//输入流
file_in.clear();
file_in.imbue(std::locale("chs"));
file_in.open(store_text.c_str());//打开文件
{   //保存时让oa工作完后先释构
boost::archive::xml_woarchive oa(file_in);
oa & BOOST_SERIALIZATION_NVP(sys_loading);
oa & BOOST_SERIALIZATION_NVP(store_for_GroupMenu_window_Info);
oa & BOOST_SERIALIZATION_NVP(message_to_message_data);
}
file_in.close();
}
//不改变原来数据内容,只是返回一个带有必要构造数据,其他数据为空的control_message_for_GroupFrame对象
control_message_for_GroupFrame_TEMPLATE_
void control_message_for_GroupFrame_QUAL_::load_for_restructured(std::wstring store_text)
{
std::wifstream file_out;//输入流
file_out.clear();
file_out.imbue(std::locale("chs"));
file_out.open(store_text.c_str());//打开文件
fixed_loading.clear();
sys_loading.clear();
store_for_GroupMenu_window_Info.clear();
message_to_message_data.clear();
control_message_for_GroupFrame linshi;
{
boost::archive::xml_wiarchive ia(file_out);
ia & BOOST_SERIALIZATION_NVP(sys_loading);
ia & BOOST_SERIALIZATION_NVP(store_for_GroupMenu_window_Info);
ia & BOOST_SERIALIZATION_NVP(linshi.message_to_message_data);
}

int i=0;
int k=0;
std::map<size_t,std::vector< std::wstring > >::iterator begin__=linshi.message_to_message_data.begin();
for(;begin__!=linshi.message_to_message_data.end();begin__++)//重新建立消息代号与命令名的映射
{
message_to_message_data.insert(std::map< size_t,std::vector< std::wstring > > :: value_type(message_to_message_data.size()+bind_data->message_range,begin__->second));
}
file_out.close();
}
// power_transmissionDlg dialog
BEGIN_MESSAGE_MAP(cad_tool_simple, CAdUiDialog)
//{{AFX_MSG_MAP(power_transmissionDlg)
ON_MESSAGE(WM_ACAD_KEEPFOCUS, OnAcadKeepFocus)
ON_WM_CLOSE()
ON_WM_NCDESTROY()
ON_COMMAND(IDC_BUTTON1_cad_simple_tool, On_add_a_menu)
ON_COMMAND(IDC_BUTTON1_cad_simple_tool2, On_save_tool)
ON_COMMAND(IDC_BUTTON1_cad_simple_tool3, On_load_tool)
ON_COMMAND_RANGE(IDC_rand, IDC_rand+808, On_ming_ling)
ON_MESSAGE(WM_HOTKEY,OnHotKey)
ON_WM_SIZE()
ON_MESSAGE(WM_GroupHeader_CRICKED,OnGroupHeaderCRICKED)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()

std::vector< struct_ > cad_tool_simple::type_name;//实例登记表
std::set<UINT> jiazaicishu;
cad_tool_simple::cad_tool_simple(std::wstring class_name_,CWnd* pParent /*=NULL*/)
: CAdUiDialog(cad_tool_simple::IDD, pParent)
{

m_GroupFrame=new MFC_GroupFrame();
//
class_attribute_.class_name=class_name_;
m_GroupFrame->get_class_attribute(class_attribute_);
//
control_message_for_GroupFrame_.bind(this);
//
f=new CFont;
}
void cad_tool_simple::OnSize(UINT nType, int cx, int cy) 
{
CWnd::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
//..
}
LRESULT cad_tool_simple::OnGroupHeaderCRICKED(WPARAM wParam, LPARAM lParam)
{   //相应菜单头被点击
if((wParam!=0)&&(lParam==1))//删除
{
if(m_GroupFrame!=0)
{
std::vector<MFC_GroupMenu *>::iterator find=control_message_for_GroupFrame_.GroupMenu.begin();
for(;find!=control_message_for_GroupFrame_.GroupMenu.end();)
{
if((*find)== (( MFC_GroupMenu* )((MFC_GroupHeader*)wParam)->GetParent()))
{
//删除对应的固定加载的项
std::wstring strTitle=(( MFC_GroupMenu* )((MFC_GroupHeader*)wParam)->GetParent())->m_MenuData.Window_Info_.strTitle;
//删除store_for_GroupMenu_window_Info记录
std::vector<Window_Info> ::iterator find_GroupMenu=control_message_for_GroupFrame_.store_for_GroupMenu_window_Info.begin();
for(;find_GroupMenu!=control_message_for_GroupFrame_.store_for_GroupMenu_window_Info.end();)
{
if((( MFC_GroupMenu* )((MFC_GroupHeader*)wParam)->GetParent())->m_MenuData.Window_Info_.strTitle==(*find_GroupMenu).strTitle)
{
//遍历菜单组中各项
for(int i=0;i<(*find_GroupMenu).GroupMenu_subitem_Info.size();i++)
{
std::wstring strTitle_=(*find_GroupMenu).GroupMenu_subitem_Info[i].strTitle;
//删除message_to_message_data记录
std::map<UINT,std::vector< std::wstring > >::iterator find2=control_message_for_GroupFrame_.message_to_message_data.begin();
for(;find2!=control_message_for_GroupFrame_.message_to_message_data.end();)
{
if((*find2).second[0]==strTitle_)
{
find2=control_message_for_GroupFrame_.message_to_message_data.erase(find2);
}
else
find2++;
}
}
find_GroupMenu=control_message_for_GroupFrame_.store_for_GroupMenu_window_Info.erase(find_GroupMenu);
}
else
{
find_GroupMenu++;
}
}
//删除GroupMenu记录
control_message_for_GroupFrame_.GroupMenu.erase(find);
}
else
{
find++;
}
}
}
On_save_tool();
On_load_tool();
}
return 1;
}
void cad_tool_simple::On_ming_ling(UINT nID)
{
std::map<size_t,std::vector< std::wstring > >::iterator find=control_message_for_GroupFrame_.message_to_message_data.find(nID);
if(find==control_message_for_GroupFrame_.message_to_message_data.end())
return ;
//
if(hot_show==1)
{
hot_show=0;
CAdUiDialog::ShowWindow(0);

}else
{
hot_show=1;
CAdUiDialog::ShowWindow(1);
}
//判断该命令是否需要加载
std::set<size_t>::iterator find_befor=jiazaicishu.find(nID);
if(find_befor!=jiazaicishu.end()||control_message_for_GroupFrame_.sys_loading.end()!=control_message_for_GroupFrame_.sys_loading.find(find->second[2]))
{
find->second[0];//命令名
find->second[1];//命令文件路径
acedGetAcadDwgView()->SetFocus();
//
std::wstring linshi;
linshi.append(find->second[2]);
linshi.append(_T(" "));
//
SendCmdToAcad(linshi);
//
}
else
{
jiazaicishu.insert(nID);
find->second[0];//命令名
find->second[1];//命令文件路径
acedGetAcadDwgView()->SetFocus();
//
std::wstring linshi;
linshi.append(_T("("));
linshi.append(_T("autoload "));
linshi.append(_T("\""));
linshi.append(find->second[1]);
linshi.append(_T("\" "));
linshi.append(_T("'"));
linshi.append(_T("("));
linshi.append(_T("\""));
linshi.append(find->second[2]);
linshi.append(_T("\""));
linshi.append(_T(")) "));
replace_for_A_and_a(linshi,(std::wstring)_T("\\"),(std::wstring)_T("/"));
//
SendCmdToAcad(linshi);
SendCmdToAcad(find->second[2]+_T(" "));

}

}
cad_tool_simple::~cad_tool_simple(void)
{
if(f!=0) delete f;
if(m_GroupFrame!=0) 
delete m_GroupFrame;
//在登记表中记录
std::vector<struct_ >::iterator find \
=std::find(type_name.begin(),type_name.end(),class_attribute_.class_name);//这里能找到得
type_name[find-type_name.begin()].delete_one();
//
for(int i=0;i!=control_message_for_GroupFrame_.GroupMenu.size();i++)
{
if(control_message_for_GroupFrame_.GroupMenu[i]==0)
delete control_message_for_GroupFrame_.GroupMenu[i];
}
};
void  cad_tool_simple::Create_and_show (void)
{
std::vector<struct_ >::const_iterator find;
if((find=std::find(type_name.begin(),type_name.end(),class_attribute_.class_name))!=type_name.end())
{
if(type_name[find-type_name.begin()].state!=0)
{//已经存在实例
type_name[find-type_name.begin()].add_one();
delete this;
}
else
{   //表示该类被加载过,但已经销毁过窗口
type_name[find-type_name.begin()].add_one();
message_range=IDC_rand+(find-type_name.begin())*200;
CAdUiDialog::Create(cad_tool_simple::IDD);
//
SetWindowText(class_attribute_.class_name.c_str());//对话框设定标题
CAdUiDialog::ShowWindow(1);
}
}
else
{   //第一次加载
jiazaicishu.clear();
type_name.push_back(struct_(class_attribute_.class_name));
type_name[type_name.size()-1].add_one();
message_range=IDC_rand+(type_name.size()-1)*200;
CAdUiDialog::Create(cad_tool_simple::IDD);
//
SetWindowText(class_attribute_.class_name.c_str());//对话框设定标题
CAdUiDialog::ShowWindow(1);
}
}
void cad_tool_simple::On_save_tool()
{
std::wstring linshi(_T("C://Cad_tool_bar//"));//输入输出时用//

XTCOW_File File_control;//
File_control.Assign(linshi);
File_control.CreateMultDir();

linshi.append(class_attribute_.class_name+_T("cad_tool")+_T(".txt"));
std::wstring F=File_control.GetHigherDirectoryName();

control_message_for_GroupFrame_.save_for_restructured(linshi);
acedGetAcadDwgView()->SetFocus();
acutPrintf(_T("\n配置已经保存"));

}
void cad_tool_simple::On_load_tool()
{
std::wstring linshi(_T("C://Cad_tool_bar//")+class_attribute_.class_name+_T("cad_tool"));
linshi.append(_T(".txt"));
//
XTCOW_File File_control;
std::wstring WorkPath=linshi;
File_control.Assign(WorkPath);
if(!File_control.Exists()==1)
{
acutPrintf(_T("\n程序在系统内第一次运行,请保存配置后再点击加载"));
return ;
}
//
jiazaicishu.clear();//情况加载记录
//
if(m_GroupFrame!=0) 
{
delete m_GroupFrame;
m_GroupFrame=0;
}
m_GroupFrame=new MFC_GroupFrame;
m_GroupFrame->SetFillColor(GroupFrame_Black_COL);
m_GroupFrame->SetFillColor(GroupFrame_Black_COL);
//重构造数据重建
control_message_for_GroupFrame_.load_for_restructured(linshi);
control_message_for_GroupFrame_.release_GroupMenu_res();
if(control_message_for_GroupFrame_.store_for_GroupMenu_window_Info.empty()) 
{
acutPrintf(_T("\n载入的内容为空"));
CRect Rect;
black_board.GetWindowRect(Rect);
ScreenToClient(Rect);
//加载菜单框架
m_GroupFrame->CreateGroupFrame(this, Rect,0);
return;
}
//建立菜单组
GroupMenu_subitem_Info kong_GroupMenu_subitem_Info(class_attribute_);
std::map<UINT,std::vector< std::wstring > >::iterator be \
=control_message_for_GroupFrame_.message_to_message_data.begin();//信息

int k=0;
for(int i=0;i<control_message_for_GroupFrame_.store_for_GroupMenu_window_Info.size();i++)
{
//建立
control_message_for_GroupFrame_.GroupMenu.push_back(new MFC_GroupMenu());
GroupMenu_window_Info menuData;
//设置组合菜单框(menuData)信息
//提取需要的信息
menuData.Window_Info_=control_message_for_GroupFrame_.store_for_GroupMenu_window_Info[i];
//恢复信息
control_message_for_GroupFrame_.GroupMenu[control_message_for_GroupFrame_.GroupMenu.size()-1]->SetMenuInfo(menuData);
//
for(int k=0;k<control_message_for_GroupFrame_.store_for_GroupMenu_window_Info[i].GroupMenu_subitem_Info.size();k++)
{
//需要的信息
GroupMenu_subitem_Info btInfo(class_attribute_);
btInfo.Window_Info_=control_message_for_GroupFrame_.store_for_GroupMenu_window_Info[i].GroupMenu_subitem_Info[k];
btInfo.Window_Info_.nBtnID=be->first;
control_message_for_GroupFrame_.GroupMenu[control_message_for_GroupFrame_.GroupMenu.size()-1]->AddMenuItem(btInfo);
be++;
}
m_GroupFrame->AddGroupMenu(control_message_for_GroupFrame_.GroupMenu[control_message_for_GroupFrame_.GroupMenu.size()-1]);
}
//
CRect Rect;
black_board.GetWindowRect(Rect);
ScreenToClient(Rect);
m_GroupFrame->CreateGroupFrame(this, Rect,0);

//加载部分cad命令//  
acedGetAcadDwgView()->SetFocus();
for(int i=0;i<control_message_for_GroupFrame_.store_for_GroupMenu_window_Info.size();i++)
{
for(int j=0;j<control_message_for_GroupFrame_.store_for_GroupMenu_window_Info[i].fixed_loading.size();j++)
{
std::wstring linshi;
linshi.append(_T("("));
linshi.append(_T("autoload "));
linshi.append(_T("\""));
linshi.append(control_message_for_GroupFrame_.store_for_GroupMenu_window_Info[i].fixed_loading[j]);
linshi.append(_T("\" "));
linshi.append(_T("'"));
linshi.append(_T("("));
linshi.append(_T("\""));
//从文件名中提取相关内容
File_control.Assign(control_message_for_GroupFrame_.store_for_GroupMenu_window_Info[i].fixed_loading[j]);
std::wstring filename=File_control.GetFileName();
int op=filename.find(_T("-"),0);
//
linshi.append(filename.substr(op+1,filename.size()-1));
linshi.append(_T("\""));
linshi.append(_T(")) "));
replace_for_A_and_a(linshi,(std::wstring)_T("\\"),(std::wstring)_T("/"));
SendCmdToAcad(linshi);
}
}
acutPrintf(_T("\n完成固定加载部分"));
SendCmdToAcad((std::wstring)_T("\033"));
//
}
void cad_tool_simple::On_add_a_menu()
{
 
if(m_GroupFrame!=0)
{
delete m_GroupFrame;
m_GroupFrame=new MFC_GroupFrame;
m_GroupFrame->get_class_attribute(class_attribute_);
for(int i=0;i!=control_message_for_GroupFrame_.GroupMenu.size();i++)
{
m_GroupFrame->AddGroupMenu(control_message_for_GroupFrame_.GroupMenu[i]);
}
load_GroupMenu_add_to_frame();
m_GroupFrame->SetFillColor(GroupFrame_Black_COL);
m_GroupFrame->SetFillColor(GroupFrame_Black_COL);

CRect Rect;
black_board.GetWindowRect(Rect);
ScreenToClient(Rect);
m_GroupFrame->CreateGroupFrame(this, Rect,0);

}

}
void cad_tool_simple::OnClose()
{
// TODO: Add your message handler code here and/or call default
CWnd::OnClose();
/*
BOOL UnregisterHotKey(HWND  hWnd, int id);
//用于在系统中注消热键 
*/
UnregisterHotKey(m_hWnd, 1501);
UnregisterHotKey(m_hWnd, 1502);
//
DestroyWindow();
}
LRESULT cad_tool_simple::OnHotKey(WPARAM wParam,LPARAM lParam)
{
if (wParam== 1501||wParam== 1502)
{
if(hot_show==1)
{
hot_show=0;
CAdUiDialog::ShowWindow(0);

}else
{
hot_show=1;
CAdUiDialog::ShowWindow(1);
}
}
return 0;
}
void cad_tool_simple::OnNcDestroy() 
{
CAdUiDialog::OnNcDestroy();
// TODO: Add your message handler code here
delete this;
}
BOOL cad_tool_simple::OnInitDialog()
{
CAdUiDialog::OnInitDialog();

//根据屏幕分辨率初始化工具栏及文字大小
y=GetSystemMetrics(SM_CYSCREEN);   //获取屏幕水平分辨率 index值SM_CXSCREEN = 0 'X Size of screen  
//SM_CYSCREEN = 1 'Y Size of Screen
X=GetSystemMetrics(SM_CXSCREEN); 
proportion_y=y/768;//屏幕分辨率
proportion_x=X/1366;//屏幕分辨率
if(y!=768) 
class_attribute_.set_class_attribute_bili(proportion_y);

CRect rcClient;
GetWindowRect(&rcClient);
                CWnd::SetWindowPos(NULL,0,0,145*proportion_x,492*proportion_y,SWP_NOZORDER|SWP_NOMOVE|CBRS_SIZE_FIXED );
//
//设置black_board大小
//按钮比例
CRect rcClient_;
add_ming_ling_zhu.GetWindowRect(rcClient_);
ScreenToClient(rcClient_);
rcClient_.SetRect(rcClient_.TopLeft().x*proportion_x, rcClient_.TopLeft().y*proportion_y, rcClient_.BottomRight().x*proportion_x, rcClient_.BottomRight().y*proportion_y);
add_ming_ling_zhu.SetWindowPos(NULL,rcClient_.TopLeft().x,rcClient_.TopLeft().y,rcClient_.Width(),rcClient_.Height(),SWP_NOZORDER);
//
save_board.GetWindowRect(rcClient_);
ScreenToClient(rcClient_);
rcClient_.SetRect(rcClient_.TopLeft().x*proportion_x, rcClient_.TopLeft().y*proportion_y, rcClient_.BottomRight().x*proportion_x, rcClient_.BottomRight().y*proportion_y);
save_board.SetWindowPos(NULL,rcClient_.TopLeft().x,rcClient_.TopLeft().y,rcClient_.Width(),rcClient_.Height(),SWP_NOZORDER);
//
load_board.GetWindowRect(rcClient_);
ScreenToClient(rcClient_);
rcClient_.SetRect(rcClient_.TopLeft().x*proportion_x, rcClient_.TopLeft().y*proportion_y, rcClient_.BottomRight().x*proportion_x, rcClient_.BottomRight().y*proportion_y);
load_board.SetWindowPos(NULL,rcClient_.TopLeft().x,rcClient_.TopLeft().y,rcClient_.Width(),rcClient_.Height(),SWP_NOZORDER);
//
black_board.GetWindowRect(rcClient_);
ScreenToClient(rcClient_);
rcClient_.SetRect(rcClient_.TopLeft().x*proportion_x, rcClient_.TopLeft().y*proportion_y, rcClient_.BottomRight().x*proportion_x, rcClient_.BottomRight().y*proportion_y);
black_board.SetWindowPos(NULL,rcClient_.TopLeft().x,rcClient_.TopLeft().y,rcClient_.Width(),rcClient_.Height(),SWP_NOZORDER);
//字体
LOGFONT SystemParam;
SystemParametersInfo(SPI_GETICONTITLELOGFONT,sizeof(LOGFONT),&SystemParam,0);
SystemParam.lfHeight*=proportion_y;
f->CreateFontIndirect(&SystemParam);
//
GetDlgItem(IDC_BUTTON1_cad_simple_tool)-> SetFont(f);
GetDlgItem(IDC_BUTTON1_cad_simple_tool2)-> SetFont(f);
GetDlgItem(IDC_BUTTON1_cad_simple_tool3)-> SetFont(f);

//定义当前为显示状态
hot_show=1;
// 热键
RegisterHotKey(m_hWnd,1501,MOD_ALT,'X');
RegisterHotKey(m_hWnd,1502,MOD_ALT,'x');
CMenu* pSysMenu = GetSystemMenu(FALSE);
if (pSysMenu != NULL)
{
CString strAboutMenu;
strAboutMenu.LoadString(IDD_DIALOG1);
if (!strAboutMenu.IsEmpty())
{
pSysMenu->AppendMenu(MF_SEPARATOR);
pSysMenu->AppendMenu(MF_STRING, IDD_DIALOG1, strAboutMenu);
}
}

SetIcon(m_hIcon, TRUE); // Set big icon
SetIcon(m_hIcon, FALSE); // Set small icon

//将工具栏移动到屏幕指定位置
CRect rect,rect1;
acedGetAcadDwgView()->GetClientRect(&rect); 
ClientToScreen(&rect);
GetClientRect(&rect1);
CalcWindowRect(&rect1);
MoveWindow(rect.left+rect.Width()/2-rect1.Width()/2,rect.top+rect.Height()*1/4,rect1.Width(),rect1.Height());

//设置m_GroupFrame的背景色
m_GroupFrame->SetFillColor(GroupFrame_Black_COL);
//设置m_GroupFrame的大小
CRect Rect;
black_board.GetWindowRect(Rect);//上面black_board的大小改了,这里就自动改了
ScreenToClient(Rect);
Rect.left++;
Rect.right--;
if (!m_GroupFrame->CreateGroupFrame(this, Rect,0))
return -1;
return 1;  // return TRUE  unless you set the focus to a control
}
void cad_tool_simple::load_GroupMenu_add_to_frame(void)
{

CString fileExtensions = _T("arx、lsp、VLX、fas文件|*.arx;*.lsp;*VLX;*fas|arx文件|*.arx|lsp文件|*.lsp|VLX文件|*VLX|fas文件|*fas||");   
CFileDialog fileDlg(TRUE,
                             NULL,
                             NULL,
                             OFN_ALLOWMULTISELECT | OFN_ENABLESIZING | OFN_HIDEREADONLY,
                              fileExtensions);
const int MIN_FILE_NUMBER = 100; 
fileDlg.m_ofn.lpstrFile = new TCHAR[_MAX_PATH * MIN_FILE_NUMBER]; //重新定义缓冲区大小          
memset(fileDlg.m_ofn.lpstrFile, 0, _MAX_PATH * MIN_FILE_NUMBER);  //初始化定义的缓冲区
fileDlg.m_ofn.nMaxFile = _MAX_PATH * MIN_FILE_NUMBER;
XTCOW_File File_control;
//
std::wstring linshi_title;
std::wstring linshi_file_name;
if (IDOK == fileDlg.DoModal())
{
  POSITION pos = fileDlg.GetStartPosition();
  POSITION pos_lisnhi=pos;
  if(NULL== pos_lisnhi) 
  {
  delete [] fileDlg.m_ofn.lpstrFile;
  return ;
  }
  control_message_for_GroupFrame_.GroupMenu.push_back(new MFC_GroupMenu);
  //
  std::set<std::wstring> AAA_file_ji_lu_de_wen_jian_lu_jing;
  std::set<std::wstring> bu_add_in_menu_de_wen_jian_ming;
  //
  int count__=0;
  int yici=0;
  while (NULL != pos_lisnhi)//第一次
  {
     TRACE(fileDlg.GetNextPathName(pos_lisnhi)); //获取文件名
 std::wstring FilePathName; 
 FilePathName=fileDlg.GetNextPathName(pos_lisnhi);//pos自动加1
 File_control.Assign(FilePathName);
 std::wstring filename=File_control.GetFileName();
 if(count__==0)//第一次加载搜索路径
 {
 count__++;
 XTCOW_File file;
 std::wstring linshi=File_control.GetPath ();
 std::set<std::wstring> linshi_set;
 file.Traverse_All_folder(linshi,linshi_set);//临时保持目录
                          std::set< std::wstring >::iterator begin=linshi_set.begin();
 for(;begin!=linshi_set.end();begin++)
 {
 if(control_message_for_GroupFrame_.included_file.end()\
 ==control_message_for_GroupFrame_.included_file.find(*begin))
 {     
   //没找到,加入
control_message_for_GroupFrame_.included_file.insert(*begin);
std::wstring  szValue(*begin);//要设置的值
//加入注册表:
CRegKey regkey;//注册表类对象
LONG lResult;//返回成功类型
lResult=regkey.Open(HKEY_CURRENT_USER,LPCTSTR(_T("Environment")),KEY_ALL_ACCESS);//打开注册表主键
if (lResult==ERROR_SUCCESS)
{
wchar_t cOwner[1000];
DWORD dSize=1000;//该字段长度
lResult=regkey.QueryValue(cOwner,LPCTSTR(_T("Path")),&dSize);//读取RegisteredOwner字段
if (lResult==ERROR_SUCCESS)
{
std::wstring strValue__(cOwner);
if(strValue__.find(szValue)==std::string::npos)//没有就加入
{
strValue__.append(_T(";"));
   strValue__.append(szValue.c_str());
strValue__.append(_T("\\"));
lResult=regkey.SetValue(LPCTSTR(strValue__.c_str()),LPCTSTR(_T("Path")));//写入RegisteredOwner字段
if (lResult!=ERROR_SUCCESS)
{
 acutPrintf(_T("\nRegOpenKeyEx失败"));
else
{
;
}
  }
regkey.Close();//关闭  
}
else
{
regkey.Close();//关闭 
HKEY hKey;
LPCTSTR lpSubKey =_T("Environment");
std::wstring strValue__;
strValue__.append(szValue.c_str());
   strValue__.append(_T("\\"));
RegOpenKeyEx(HKEY_CURRENT_USER, lpSubKey, 0, KEY_ALL_ACCESS, &hKey);
RegSetValueEx(hKey,_T("Path"), 0L, REG_EXPAND_SZ, (const BYTE *)LPCTSTR(strValue__.c_str()), strValue__.size()*sizeof(wchar_t) + 1);
RegCloseKey(hKey);
}
  
}
 }  
}

 }
 int kk=filename.find(_T("AAA"),0);
 //
 if((kk!=std::wstring::npos))//找到了
 {
   bu_add_in_menu_de_wen_jian_ming.insert(FilePathName);//AAA类文件夹名称//它们不能载入//不能显示的路径
   std::wifstream fin;
fin.open(FilePathName.c_str());
fin.imbue(std::locale("chs"));
//
wchar_t next[300];
fin.getline(next,300);
fin.close();
std::wstring neirong(next);
int kkd=neirong.find_last_not_of('/0');
neirong.erase(kkd+1,neirong.size());
int find=neirong.find(_T("+"),0);
//
if((find!=std::wstring::npos)&&(yici==0))
{   //找标志//
yici++;
linshi_title=next;
linshi_file_name=next;
linshi_title.erase(find,linshi_title.size());
linshi_file_name.erase(0,find+1);
//
std::wstring ddd= File_control.GetPath();
ddd.append(linshi_file_name);
//
AAA_file_ji_lu_de_wen_jian_lu_jing.insert(ddd);//它们是要载入的路径//但不能显示的路径//来源于文件内容
}else if(find==std::wstring::npos)//找到了
{//
std::wstring ddd= File_control.GetPath();
ddd.append(next);
AAA_file_ji_lu_de_wen_jian_lu_jing.insert(ddd);//它们是要载入的路径//但不能显示的路径//来源于文件内容
}
 }
  }
  //如果上一循环建立了一个GroupMenu对象
  if(!linshi_title.empty())
  {
  GroupMenu_window_Info menuData;
//设置组合菜单框(Window_Info)信息
menuData.Window_Info_.strTitle = linshi_title;
menuData.Window_Info_.bStatus = FALSE;
menuData.Window_Info_.bTransparentBk = 0;
menuData.Window_Info_.crFill=MENU_Black_COL;
//
menuData.Window_Info_.fixed_loading.insert(menuData.Window_Info_.fixed_loading.begin(),AAA_file_ji_lu_de_wen_jian_lu_jing.begin(),AAA_file_ji_lu_de_wen_jian_lu_jing.end());//记录它们是要载入的路径//但不能显示的路径//来源于文件内容
//给新建的GroupMenu对象赋Window_Info值
control_message_for_GroupFrame_.GroupMenu[control_message_for_GroupFrame_.GroupMenu.size()-1]->SetMenuInfo(menuData);
//保存新建GroupMenu对象的Window_Info值
control_message_for_GroupFrame_.store_for_GroupMenu_window_Info.push_back(menuData.Window_Info_);
  }
  int count=0;
  int uuu=0;
  while (NULL != pos)//第二次
  {
 TRACE(fileDlg.GetNextPathName(pos)); //获取文件名
 std::wstring FilePathName; 
 FilePathName=fileDlg.GetNextPathName(pos);
 File_control.Assign(FilePathName);
 std::wstring HigherDirectoryName= File_control.GetHigherDirectoryName();
 std::wstring filename=File_control.GetFileName();
 //排查
 if(AAA_file_ji_lu_de_wen_jian_lu_jing.end()!=AAA_file_ji_lu_de_wen_jian_lu_jing.find(FilePathName))//它们是要载入的路径//但不能显示的路径
 {//固定加载项及忽略显示项
control_message_for_GroupFrame_.fixed_loading.push_back(FilePathName);
//将自动加载部分在此加载
acedGetAcadDwgView()->SetFocus();
//
if(uuu==0) SendCmdToAcad((std::wstring)_T("\033"));
uuu++;
std::wstring linshi;
linshi.append(_T("("));
linshi.append(_T("autoload "));
linshi.append(_T("\""));
linshi.append(FilePathName);
linshi.append(_T("\" "));
linshi.append(_T("'"));
linshi.append(_T("("));
linshi.append(_T("\""));
//
XTCOW_File File_control;
File_control.Assign(FilePathName);
std::wstring filename=File_control.GetFileName();
int op=filename.find(_T("-"),0);
//
linshi.append(filename.substr(op+1,filename.size()));
linshi.append(_T("\""));
linshi.append(_T(")) "));
replace_for_A_and_a(linshi,(std::wstring)_T("\\"),(std::wstring)_T("/"));
SendCmdToAcad(linshi);
continue ;
 }
 //AAA类文件夹名称//它们不能载入//不能显示的路径
 std::set<std::wstring>::iterator find_=bu_add_in_menu_de_wen_jian_ming.find(FilePathName);
 if(find_!=bu_add_in_menu_de_wen_jian_ming.end())
 {
 continue ;
 }
 //使用文件...//如果第一循环没有建立菜单组
 if((count==0)&&(linshi_title.size()==0))//
 {
GroupMenu_window_Info menuData;
//设置组合菜单框(Window_Info)信息
menuData.Window_Info_.strTitle = HigherDirectoryName.c_str();
menuData.Window_Info_.bStatus = FALSE;
menuData.Window_Info_.bTransparentBk = 0;
menuData.Window_Info_.crFill=MENU_Black_COL;
menuData.Window_Info_.fixed_loading.insert(menuData.Window_Info_.fixed_loading.begin(),AAA_file_ji_lu_de_wen_jian_lu_jing.begin(),AAA_file_ji_lu_de_wen_jian_lu_jing.end());//记录它们是要载入的路径//但不能显示的路径//来源于文件内容
//给新建的GroupMenu对象赋Window_Info值
control_message_for_GroupFrame_.GroupMenu[control_message_for_GroupFrame_.GroupMenu.size()-1]->SetMenuInfo(menuData);
//保存新建GroupMenu对象的Window_Info值
control_message_for_GroupFrame_.store_for_GroupMenu_window_Info.push_back(menuData.Window_Info_);
 
 }
count++;
 //下面是能载入能显示的
 int op=filename.find(_T("-"),0);
 //记录cad在工具栏打开前会自动加载的项目
 {
   
FILE* pfile = _wfopen(FilePathName.c_str(),_T("rt")); 
fseek(pfile,0,SEEK_END);   
long v_fSet   =ftell(pfile);  
//返回值v_fSet为 0时文件为空。
 if (v_fSet==0) //为空
{  
//提取命令内容
std::wstring filename__=filename;
int op=filename__.find(_T("-"),0);
//
control_message_for_GroupFrame_.sys_loading.insert(filename.substr(op+1,filename.size()-1)); 
}  
 }
//设置组合菜单框对象各子项的Window_Info信息
GroupMenu_subitem_Info btInfo(class_attribute_);
btInfo.Window_Info_.strTitle=(filename.c_str());
btInfo.Window_Info_.nIcon = 0;
btInfo.Window_Info_.nBitmap = 0;
//建立消息代号与命令名的映射
control_message_for_GroupFrame_.message_to_message_data.insert(std::map<UINT,std::vector< std::wstring > > :: value_type(message_range+control_message_for_GroupFrame_.message_to_message_data.size(),(std::vector<std::wstring >)boost::assign::list_of(filename)(FilePathName)(filename.substr(op+1,filename.size()-1))));
btInfo.Window_Info_.nBtnID = control_message_for_GroupFrame_.message_to_message_data.size()-1+message_range;////提供消息代号
//在GroupMenu对象中加入子项的Window_Info信息
control_message_for_GroupFrame_.GroupMenu[control_message_for_GroupFrame_.GroupMenu.size()-1]->AddMenuItem(btInfo);
//保存加入子项的Window_Info信息
control_message_for_GroupFrame_.store_for_GroupMenu_window_Info[control_message_for_GroupFrame_.GroupMenu.size()-1].GroupMenu_subitem_Info.push_back(btInfo.Window_Info_);
}
  m_GroupFrame->AddGroupMenu(control_message_for_GroupFrame_.GroupMenu[control_message_for_GroupFrame_.GroupMenu.size()-1]);
}

delete[] fileDlg.m_ofn.lpstrFile;     //最后别忘了释放内存
}
void cad_tool_simple::DoDataExchange(CDataExchange* pDX)
{
CAdUiDialog::DoDataExchange(pDX);
DDX_Control(pDX, IDC_BUTTON1_cad_simple_tool, add_ming_ling_zhu);//按钮
DDX_Control(pDX, IDC_BUTTON1_cad_simple_tool2, save_board);//按钮
DDX_Control(pDX, IDC_BUTTON1_cad_simple_tool3, load_board);//按钮
DDX_Control(pDX, IDC_STATIC_cad_simple_tool, black_board);//框架
}
// power_transmissionDlg message handlers
//----- Needed for modeless dialogs to keep focus.
//----- Return FALSE to not keep the focus, return TRUE to keep the focus
LRESULT cad_tool_simple::OnAcadKeepFocus (WPARAM, LPARAM) {
return (TRUE) ;
}
BOOL cad_tool_simple::PreTranslateMessage(MSG* pMsg) 
{
// TODO: Add your specialized code here and/or call the base class
if( pMsg->message == WM_KEYDOWN )
{
   switch(pMsg->wParam)
{
case VK_RETURN:
case VK_ESCAPE: 
{
::TranslateMessage(pMsg);
::DispatchMessage(pMsg);
return TRUE;
}
}
}
return CAdUiDialog::PreTranslateMessage(pMsg);
}
}
//结构1
// GroupStruct.h : header file
#pragma once
#ifndef head_list_h_12
#define head_list_h_12
namespace xtcow
{
#define FRAME_CLASSNAME _T("GroupFrameCtrl")
#define MENU_CLASSNAME _T("GroupMenuCtrl")
#define HEADER_CLASSNAME _T("GroupMenuHeader")
#define ITEM_CLASSNAME _T("GroupMenuItem")


#define MENUTITLE_HEIGHT 22//菜单表头高度
#define MENUICON_WIDTH 20//菜单表头图标宽
#define BUTTON_HEIGHT 20//菜单子项高度,含表头写标题项
#define MENUICON_DRAG 2//菜单表头图标离菜单表头上线以下的距离(MENUTITLE_HEIGHT_-BUTTON_HEIGHT_==MENUICON_DRAG_时,菜单表头图标在菜单子项高度内)
#define MARGIN 2 //表头标题文字横移距离
//
#define BUTTON_MAGIN 8 //菜单子项图标和子项标题横移距离
//
#define BTNICON_WIDTH 16//菜单子项图标宽度
#define BTNICON_HEIGHT 16//菜单子项图标高度
////GroupFrame背景颜色
#define GroupFrame_Black_COL RGB(200,200,169)
//组合菜单顶部文本标题背景渐变颜色:从左到右
#define MENUTITLE_LEFT_COL RGB(178,178,178)
#define MENUTITLE_RIGHT_COL RGB(255,255,255)
//组合菜单背景色
#define MENU_Black_COL RGB(207,207,207)
//组合菜单文本颜色和字体大小
#define MENU_OVER_COL RGB(255,255,255)
#define MENU_NORMAL_COL RGB(255,255,255)
#define MENU_FONT_SIZE 15
//子项目文本颜色和字体大小
#define BTN_NORMAL_COL RGB(0,0,0)
#define BTN_OVER_COL RGB(0,0,0)
#define BTN_FONT_SIZE 14
//组合菜单打开的时候边框颜色
#define MENU_WIDGET_COL RGB(225,221,98)
//组合菜单打开时内部背景渐变颜色:从上到下
#define MENU_TOP_COL RGB(29, 37, 10)
//#define MENU_BOTTOM_COL RGB(76, 181, 81)
//#define MENU_BOTTOM_COL RGB(79, 66, 191)
//#define MENU_BOTTOM_COL RGB(62, 192, 196)
//#define MENU_BOTTOM_COL RGB(191, 199, 58)
//#define MENU_BOTTOM_COL RGB(202, 78, 55)
//#define MENU_BOTTOM_COL RGB(202, 55, 191)
//组合框头部打开关闭窗体ID
#define IDC_MENUHEADER 1111111
//用户更新窗体位置消息,可以不处理
#define WM_UPDATEPOS WM_USER+1
#define WM_leave WM_USER+2
#define IDC_GROUPMENU 2222222
}
#endif
//结构2
// GroupStruct.h : header file
//
#pragma once
#ifndef Window_Info_h
#define Window_Info_h
namespace xtcow
{
class Window_Info
{
friend class boost::serialization::access;
private:
template<class Archive>
void serialize(Archive& archive, const unsigned int version)
{
archive & BOOST_SERIALIZATION_NVP(strTitle);
archive & BOOST_SERIALIZATION_NVP(bStatus);
archive & BOOST_SERIALIZATION_NVP(nIcon);
archive & BOOST_SERIALIZATION_NVP(nBitmap);
archive & BOOST_SERIALIZATION_NVP(nIcon_state_1);

archive & BOOST_SERIALIZATION_NVP(nIcon_state_2);
archive & BOOST_SERIALIZATION_NVP(bTransparentBk);
archive & BOOST_SERIALIZATION_NVP(crGradFill);
archive & BOOST_SERIALIZATION_NVP(crFill);
archive & BOOST_SERIALIZATION_NVP(nBtnID);
//
archive & BOOST_SERIALIZATION_NVP(GroupMenu_subitem_Info);
archive & BOOST_SERIALIZATION_NVP(fixed_loading);
//
}
public:
Window_Info()//提供给菜单组用的,记录菜单组详细情况;同时局部内容提供给子菜单用,空间浪费点
bStatus=0; //组合菜单框对象使用,设定打开闭合
//
nIcon=0; //组合菜单框对象和其各子项共用项
nBitmap=0; //组合菜单框对象和其各子项共用项
nIcon_state_1=0;nIcon_state_2=0; //组合菜单框对象使用要同时定义
//
bTransparentBk=0; //组合菜单框对象使用,子项都定义为透明的,其颜色取决于组合菜单框的背景色
//
crGradFill=0; //组合菜单框对象填充背景使用(渐变)
crFill=0; //组合菜单框对象填充背景使用(非渐变)
//
nBtnID=0; //组合菜单框对象和其各子项共用项,对应消息命令
}
~Window_Info(){};
bool operator==(const Window_Info &struct_window)const
{
if(struct_window.strTitle!=strTitle) 
return 0;
if(struct_window.nIcon!=nIcon) 
return 0;
if(struct_window.nBitmap!=nBitmap) 
return 0;
if(struct_window.nBtnID!=nBtnID) 
return 0;
if(struct_window.bStatus!=bStatus) 
return 0;
if(struct_window.bTransparentBk!=bTransparentBk) 
return 0;
if(struct_window.crGradFill!=crGradFill) 
return 0;
if(struct_window.crFill!=crFill) 
return 0;
if(struct_window.nIcon!=nIcon_state_1) 
return 0;
if(struct_window.nIcon!=nIcon_state_2) 
return 0;
return 1;

}
bool operator!=(const Window_Info &struct_window)const
{
if(struct_window.strTitle==strTitle) 
return 0;
return 1;
}
std::wstring strTitle; //标题
UINT nIcon; //图标
UINT nBitmap; //位图
UINT nBtnID; //命令ID
BOOL bStatus; //是否打开GroupMenu的图标和当前状态图标:打开TRUE,关闭FALSE
BOOL bTransparentBk; //背景是否透明
COLORREF crGradFill; //背景色||渐变
COLORREF crFill; //背景色||非渐变
UINT nIcon_state_1; //GroupMenu的状态图标句柄1
UINT nIcon_state_2; //GroupMenu的状态图标句柄1
HCURSOR m_hCursor;
std::vector<Window_Info> GroupMenu_subitem_Info;
std::vector<std::wstring > fixed_loading;
};

}
#endif

//结构3
// GroupMenu.h : header file
//
#pragma once
#ifndef GroupMenu_window_Info_H
#define GroupMenu_window_Info_H
#include "Window_Info.h"
#include "GroupHeader.h"
#include "GroupMenu_subitem_Info.h"
namespace xtcow
{
typedef CTypedPtrList<CPtrList, GroupMenu_subitem_Info*> TButtonList;
class GroupMenu_window_Info
{
public:
Window_Info   Window_Info_;
//GroupMenu头部
TButtonList BtnList; //GroupMenu的子项列表
MFC_GroupHeader btnHeader;
GroupMenu_window_Info(){};
~GroupMenu_window_Info(){};
bool operator==(const GroupMenu_window_Info &struct_window)const
{
if((struct_window.Window_Info_)==(struct_window.Window_Info_)) 
return 1;
else
return 0;

}
};
}
#endif 

//结构4
// GroupMenu.h : header file
//
#pragma once
#ifndef GroupMenu_subitem_Info_H
#define GroupMenu_subitem_Info_H
#include "Window_Info.h"
#include "GroupButton.h"
#include "class_attribute.h"
/////////////////////////////////////////////////////////////////////////////
namespace xtcow
{
class GroupMenu_subitem_Info
{
public:
Window_Info   Window_Info_;
MFC_GroupButton *btn; //GroupMenu中子项
GroupMenu_subitem_Info(class_attribute& class_attribute_)
{
btn=new MFC_GroupButton();
};
~GroupMenu_subitem_Info()
{
delete btn;
};
};
}
#endif 

//结构5
// GroupMenu.h : header file
//
#pragma once
#ifndef class_attribute_H
#define class_attribute_H
#include "head_list.h"
namespace xtcow
{   //提供给每个GroupFrame类使用,提供参数
class class_attribute
{
public:
int MENUTITLE_HEIGHT_;
int MENUICON_WIDTH_ ;
int BUTTON_HEIGHT_;
int MENUICON_DRAG_;
int MARGIN_;
int BUTTON_MAGIN_;
int BTNICON_WIDTH_;
int BTNICON_HEIGHT_;
int MENU_FONT_SIZE_;
int BTN_FONT_SIZE_;
//
std::wstring class_name;
//
class_attribute()
{
MENUTITLE_HEIGHT_=MENUTITLE_HEIGHT;
MENUICON_WIDTH_=MENUICON_WIDTH ;
BUTTON_HEIGHT_=BUTTON_HEIGHT;
MENUICON_DRAG_=MENUICON_DRAG;
MARGIN_=MARGIN;
BUTTON_MAGIN_=BUTTON_MAGIN;
BTNICON_WIDTH_=BTNICON_WIDTH;
BTNICON_HEIGHT_=BTNICON_HEIGHT;
MENU_FONT_SIZE_=MENU_FONT_SIZE;
BTN_FONT_SIZE_=BTN_FONT_SIZE;
};
class_attribute(std::wstring class_name_):class_attribute()
{
class_name=class_name_;
};
~class_attribute(){};
void set_class_attribute_bili(double t)
{
MENUTITLE_HEIGHT_*=t;
MENUICON_WIDTH_*=t ;
BUTTON_HEIGHT_*=t;
MENUICON_DRAG_*=t;
MARGIN_*=t;
BUTTON_MAGIN_*=t;
BTNICON_WIDTH_*=t;
BTNICON_HEIGHT_*=t;
MENU_FONT_SIZE_*=t;
BTN_FONT_SIZE_*=t;
};
};
}
#endif 




     
       


路过

雷人
3

握手

鲜花

鸡蛋

刚表态过的朋友 (3 人)

发表评论 评论 (6 个评论)

回复 qishulin 2013-11-19 07:42
很好的东西。研究研究
回复 cuyongping 2013-11-19 16:44
不怎么明白!
回复 风树 2013-11-19 16:58
cuyongping: 不怎么明白!
    所以我也不想碰它了,抱着“尽量使用一些不熟练的东西”及对象化的想法,简单问题搞复杂了,但有了这个过程还是好的。
回复 gzxl 2014-6-15 21:31
需要下面的代码及控件代码的.h和.cpp文件格式
gzxl90@126.com
多谢了
回复 风树 2014-6-15 22:52
gzxl: 需要下面的代码及控件代码的.h和.cpp文件格式
gzxl90@126.com
多谢了
都打包在arx论坛上的另一个帖子里
回复 jxy308 2015-1-14 10:59
157650007@qq.com

facelist doodle 涂鸦板

您需要登录后才可以评论 登录 | 注册

小黑屋|手机版|CAD论坛|CAD教程|CAD下载|联系我们|关于明经|明经通道 ( 粤ICP备05003914号 )  
©2000-2023 明经通道 版权所有 本站代码,在未取得本站及作者授权的情况下,不得用于商业用途

GMT+8, 2024-5-12 20:25 , Processed in 0.127087 second(s), 16 queries , Gzip On.

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

返回顶部