|
ArmKing
初级用户
 
积分 66
发帖 22
注册 2006-8-27
状态 离线
|
『第 91 楼』:
如何支持 LCD Touch Panel?
使用 LLM 解释/回答一下
请问配备相关硬件情况下,软件如何支持 LCD Touch Panel?
Please ask under what circumstances of equipped with relevant hardware, how does the software support LCD Touch Panel?
|
|
2006-8-28 02:03 |
|
|
ArmKing
初级用户
 
积分 66
发帖 22
注册 2006-8-27
状态 离线
|
『第 92 楼』:
使用 LLM 解释/回答一下
WinSail 内的某些控件做的有些小问题, 请问如何修改啊? 内核源码, 控件源码会公开吗?
There are some small issues with certain controls in WinSail. How can I modify them? Will the kernel source code and control source code be made public?
|
|
2006-8-28 02:06 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 93 楼』:
使用 LLM 解释/回答一下
关于鼠标触摸屏:
(1)在InitSystem()这前,向WinSail内核注册用户自己编写的鼠标功能调用函数
::AfxRegisterMouseFc(::MyMouse_Touch);
其中MyMouse_Touch的原型为:
void far MyMouse_Touch(unsigned int ax, unsigned int bx,
unsigned int cx, unsigned int dx);
void far MyMouse_Touch(unsigned int ax, unsigned int bx,
unsigned int cx, unsigned int dx)
{
//Register AX = 0 --> Reset Mouse
//Register AX = 1 --> Open Mouse
//Register AX = 2 --> Close Mouse
//Register AX = 3 --> IsMouseDown
//Register AX = 4 --> SetMouseLocation
REGS regs;
_fmemset(®s, 0, sizeof(REGS));
/*
在这时编写您自己的代码,参考鼠标功能调用INT33,根据入口和出口格式化regs寄存器
Register AX = 0 --> Reset Mouse ->复位鼠标
Register AX = 1 --> Open Mouse ->显示鼠标
Register AX = 2 --> Close Mouse ->不显示鼠标
Register AX = 3 --> IsMouseDown ->取按键信息
Register AX = 4 --> SetMouseLocation ->设置鼠标位置
*/
//.....
//.....
//....
//这里根据regs返回值,格式化鼠标消息结构MOUSEMSG SystemMouse
switch(ax)
{
case 0: //Reset Mouse
{
if (regs.x.ax == (unsigned) - 1)
{
SystemMouse.exist = 1;
}
else
{
SystemMouse.exist = 0;
}
SystemMouse.visible = FALSE;
break;
}
case 1: //Open Mouse
case 2: //Close Mouse
{
break;
}
case 3: //IsMouseDown
{
SystemMouse.statue = regs.x.bx;
SystemMouse.point.x = regs.x.cx;
SystemMouse.point.y = regs.x.dx;
break;
}
case 4: //SetMouseLocation
{
SystemMouse.statue = 0;
SystemMouse.times = 0;
SystemMouse.point.x = cx;
SystemMouse.point.y = dx;
break;
}
default:
{
break;
}
}
return;
}
### About Mouse Touch Screen:
(1) Before InitSystem(), register the user's own written mouse function call function with the WinSail kernel
::AfxRegisterMouseFc(::MyMouse_Touch);
Among them, the prototype of MyMouse_Touch is:
void far MyMouse_Touch(unsigned int ax, unsigned int bx,
unsigned int cx, unsigned int dx);
void far MyMouse_Touch(unsigned int ax, unsigned int bx,
unsigned int cx, unsigned int dx)
{
//Register AX = 0 --> Reset Mouse
//Register AX = 1 --> Open Mouse
//Register AX = 2 --> Close Mouse
//Register AX = 3 --> IsMouseDown
//Register AX = 4 --> SetMouseLocation
REGS regs;
_fmemset(®s, 0, sizeof(REGS));
/*
Write your own code here, refer to the mouse function call INT33, format the regs register according to the entry and exit
Register AX = 0 --> Reset Mouse -> Reset mouse
Register AX = 1 --> Open Mouse -> Display mouse
Register AX = 2 --> Close Mouse -> Do not display mouse
Register AX = 3 --> IsMouseDown -> Get key information
Register AX = 4 --> SetMouseLocation -> Set mouse position
*/
//.....
//.....
//....
// Format the mouse message structure MOUSEMSG SystemMouse according to the regs return value here
switch(ax)
{
case 0: //Reset Mouse
{
if (regs.x.ax == (unsigned) - 1)
{
SystemMouse.exist = 1;
}
else
{
SystemMouse.exist = 0;
}
SystemMouse.visible = FALSE;
break;
}
case 1: //Open Mouse
case 2: //Close Mouse
{
break;
}
case 3: //IsMouseDown
{
SystemMouse.statue = regs.x.bx;
SystemMouse.point.x = regs.x.cx;
SystemMouse.point.y = regs.x.dx;
break;
}
case 4: //SetMouseLocation
{
SystemMouse.statue = 0;
SystemMouse.times = 0;
SystemMouse.point.x = cx;
SystemMouse.point.y = dx;
break;
}
default:
{
break;
}
}
return;
}
|
|
2006-8-28 11:26 |
|
|
profree
中级用户
  
积分 478
发帖 132
注册 2003-7-2
状态 离线
|
『第 94 楼』:
使用 LLM 解释/回答一下
winsail里如何获得复选框和单选框的状态?
我用GetRadio()不能获取
How to get the status of checkboxes and radio buttons in winsail? I can't get it with GetRadio()
|
|
2006-9-18 23:39 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 95 楼』:
使用 LLM 解释/回答一下
用CRadio::SetBox()函数来设置复选框还是单选框。
用CRadio::SetRadio()函数来设置复选框/单选框的状态。
用CRadio::GetRadio()函数来获得复选框/单选框的状态。
用CRadio::GetStatic()函数来设置单选框的组属性。
对于单选框来说:有一个“组”的问题,如同Windows中的VC按钮控件的WS_GROUP属性。在一组中,只有组中的第一个CRadio才能有WS_GROUP属性。
假设有3个单选按钮,其构成3选一的一组逻辑操作,分别是
CRadio* pRadio1 --- 单选按钮1,内容为“男性”
CRadio* pRadio2 --- 单选按钮2,内容为“女性”
CRadio* pRadio3 --- 单选按钮3,内容为“保密”
.........
CRadio* pRadio1 = new CRadio(pDialog); //分配实例
CRadio* pRadio2 = new CRadio(pDialog); //分配实例
CRadio* pRadio3 = new CRadio(pDialog); //分配实例
pRadio1->CreateObject(10,30 + 18 * 0, 100, 16, "男性");
pRadio2->CreateObject(10,30 + 18 * 1, 100, 16, "女性");
pRadio3->CreateObject(10,30 + 18 * 2, 100, 16, "保密");
pRadio1->SetBoX(FALSE); //是单选按钮,不是复选按钮
pRadio2->SetBoX(FALSE); //是单选按钮,不是复选按钮
pRadio3->SetBoX(FALSE); //是单选按钮,不是复选按钮
pRadio1->SetStatic(TRUE); //Radio1控件是Radio1~3单选按钮一组的第一个。
................
为了获得该组中是哪一个被选中,只能遍历该组中的每一个成员。
if (pRadio1->GetRadio())
{
}
else if (pRadio2->GetRadio())
{
}
else if (pRadio3->GetRadio())
{
}
........
所以profree提出的问题,可能是指“单选按钮”吧!
Use the CRadio::SetBox() function to set a check box or a radio button.
Use the CRadio::SetRadio() function to set the state of a check box/radio button.
Use the CRadio::GetRadio() function to get the state of a check box/radio button.
Use the CRadio::GetStatic() function to set the group property of a radio button.
For radio buttons: there is a "group" issue, similar to the WS_GROUP attribute of the VC button control in Windows. In a group, only the first CRadio in the group can have the WS_GROUP attribute.
Suppose there are 3 radio buttons, which form a 3-choice logic operation, namely
CRadio* pRadio1 --- Radio button 1, with the content "Male"
CRadio* pRadio2 --- Radio button 2, with the content "Female"
CRadio* pRadio3 --- Radio button 3, with the content "Confidential"
.........
CRadio* pRadio1 = new CRadio(pDialog); // Allocate an instance
CRadio* pRadio2 = new CRadio(pDialog); // Allocate an instance
CRadio* pRadio3 = new CRadio(pDialog); // Allocate an instance
pRadio1->CreateObject(10, 30 + 18 * 0, 100, 16, "Male");
pRadio2->CreateObject(10, 30 + 18 * 1, 100, 16, "Female");
pRadio3->CreateObject(10, 30 + 18 * 2, 100, 16, "Confidential");
pRadio1->SetBoX(FALSE); // It is a radio button, not a check button
pRadio2->SetBoX(FALSE); // It is a radio button, not a check button
pRadio3->SetBoX(FALSE); // It is a radio button, not a check button
pRadio1->SetStatic(TRUE); // The Radio1 control is the first one in the group of Radio1~3 radio buttons.
................
To get which one in the group is selected, you can only traverse each member of the group.
if (pRadio1->GetRadio())
{
}
else if (pRadio2->GetRadio())
{
}
else if (pRadio3->GetRadio())
{
}
........
So the problem raised by profree may refer to "radio buttons"!
|
|
2006-9-19 03:55 |
|
|
profree
中级用户
  
积分 478
发帖 132
注册 2003-7-2
状态 离线
|
『第 96 楼』:
使用 LLM 解释/回答一下
谢谢回复
如果是复选框又怎么获得哪些项被选中了呢?
我很是搞不明白,如果我的一个窗口中有多个单选框/复选框,是分为一个以上组的,怎么分清是属于哪个组,又要怎么设置才能分开呢?
比如:
性别 分为 男,女,
年龄分为:15-20,21-30,31-40,
学历:大专,本科,硕士,博士
以上三个组都是同一窗口中,怎么分开设置,我认为应该有一个“归属于哪个组”的概念就好办多了
另外,如果一个对话框要设计成上一步,下一步,具体该怎么做?难道是上一步,下一步都要分别调用另一个函数来“画”对话框吗?这样如果对话框“画”多了,程序会就自动退出(应该是内存不够吧)
Thanks for the reply.
How to get which items are selected if it's a checkbox?
I really don't understand. If I have multiple radio buttons/checkboxes in a window, and they are divided into more than one group, how to distinguish which group they belong to, and how to set them apart?
For example:
Gender is divided into male, female,
Age is divided into: 15 - 20, 21 - 30, 31 - 40,
Education: junior college, bachelor's degree, master's degree, doctorate
The above three groups are all in the same window. How to set them apart. I think it would be easier if there is a concept of "belonging to which group".
In addition, if a dialog box is to be designed to have previous step and next step, how to specifically do it? Does it mean that both previous step and next step need to call another function to "draw" the dialog box respectively? If there are too many dialog boxes "drawn", the program will automatically exit (probably because of insufficient memory).
|
|
2006-9-19 22:54 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 97 楼』:
使用 LLM 解释/回答一下
VC++生成对话框,MakeDlg转换成WinSail的源代码,阅读之,可以较好的了解。
关于单选按钮(适用于WinSail及微软的Windows)
(1)一个对话框中,可以有多“组”单选按钮
(2)一组单选按钮中,所有的单选按钮必须是连续分配的。
(3)一组单选按钮中的第一个单选按钮的属性是带有WS_GROUP窗口风格的
如果是VC,在单选按钮的属性框中选中Static属性。
如果是Winsail,调用CRadio::SetStatic(TRUE);
(4)假设有3组单选按钮
第一组是性别 分为 男,女,
第二组是年龄:15-20,21-30,31-40,
第三组是学历:大专,本科,硕士,博士
//第一组
CRadio* pRadio1 = new CRadio(pDialog); //分配实例
CRadio* pRadio2 = new CRadio(pDialog); //分配实例
pRadio1->CreateObject(10,30 + 18 * 0, 100, 16, "男");
pRadio2->CreateObject(10,30 + 18 * 1, 100, 16, "女");
pRadio1->SetBox(FALSE); //是单选按钮,不是复选按钮
pRadio2->SetBox(FALSE); //是单选按钮,不是复选按钮
pRadio1->SetStatic(TRUE); //Radio1控件是Radio1-2的组带头人
//第二组
CRadio* pRadio3 = new CRadio(pDialog); //分配实例
CRadio* pRadio4 = new CRadio(pDialog); //分配实例
CRadio* pRadio5 = new CRadio(pDialog); //分配实例
pRadio3->CreateObject(10,50 + 18 * 0, 100, 16, "15-20");
pRadio4->CreateObject(10,50 + 18 * 1, 100, 16, "21-30");
pRadio5->CreateObject(10,50 + 18 * 2, 100, 16, "31-40");
pRadio3->SetStatic(TRUE); //Radio3控件是Radio3-5的组带头人
//第三组
CRadio* pRadio6 = new CRadio(pDialog); //分配实例
CRadio* pRadio7 = new CRadio(pDialog); //分配实例
CRadio* pRadio8 = new CRadio(pDialog); //分配实例
CRadio* pRadio9 = new CRadio(pDialog); //分配实例
pRadio6->CreateObject(10,70 + 18 * 0, 100, 16, "大专");
pRadio7->CreateObject(10,70 + 18 * 1, 100, 16, "本科");
pRadio8->CreateObject(10,70 + 18 * 2, 100, 16, "硕士");
pRadio9->CreateObject(10,70 + 18 * 3, 100, 16, "博士");
pRadio6->SetStatic(TRUE); //Radio6控件是Radio6-9的组带头人
------------------------------------------------------------
WinSail V2.0的GUI有一些已经更新,可重新下载了!
Generating a dialog box with VC++, converting MakeDlg to the source code of WinSail, and reading it can help you understand it better.
Regarding radio buttons (applicable to WinSail and Microsoft Windows)
(1) In a dialog box, there can be multiple "groups" of radio buttons
(2) All radio buttons in a group must be continuously allocated.
(3) The property of the first radio button in a group is to have the WS_GROUP window style
If it is VC, check the Static property in the property box of the radio button.
If it is Winsail, call CRadio::SetStatic(TRUE);
(4) Suppose there are 3 groups of radio buttons
The first group is gender, divided into male, female,
The second group is age: 15 - 20, 21 - 30, 31 - 40,
The third group is education: junior college, bachelor's degree, master's degree, doctor's degree
//First group
CRadio* pRadio1 = new CRadio(pDialog); //Allocate instance
CRadio* pRadio2 = new CRadio(pDialog); //Allocate instance
pRadio1->CreateObject(10, 30 + 18 * 0, 100, 16, "Male");
pRadio2->CreateObject(10, 30 + 18 * 1, 100, 16, "Female");
pRadio1->SetBox(FALSE); //It is a radio button, not a check box
pRadio2->SetBox(FALSE); //It is a radio button, not a check box
pRadio1->SetStatic(TRUE); //Radio1 control is the leader of the group of Radio1 - 2
//Second group
CRadio* pRadio3 = new CRadio(pDialog); //Allocate instance
CRadio* pRadio4 = new CRadio(pDialog); //Allocate instance
CRadio* pRadio5 = new CRadio(pDialog); //Allocate instance
pRadio3->CreateObject(10, 50 + 18 * 0, 100, 16, "15 - 20");
pRadio4->CreateObject(10, 50 + 18 * 1, 100, 16, "21 - 30");
pRadio5->CreateObject(10, 50 + 18 * 2, 100, 16, "31 - 40");
pRadio3->SetStatic(TRUE); //Radio3 control is the leader of the group of Radio3 - 5
//Third group
CRadio* pRadio6 = new CRadio(pDialog); //Allocate instance
CRadio* pRadio7 = new CRadio(pDialog); //Allocate instance
CRadio* pRadio8 = new CRadio(pDialog); //Allocate instance
CRadio* pRadio9 = new CRadio(pDialog); //Allocate instance
pRadio6->CreateObject(10, 70 + 18 * 0, 100, 16, "Junior College");
pRadio7->CreateObject(10, 70 + 18 * 1, 100, 16, "Bachelor's Degree");
pRadio8->CreateObject(10, 70 + 18 * 2, 100, 16, "Master's Degree");
pRadio9->CreateObject(10, 70 + 18 * 3, 100, 16, "Doctor's Degree");
pRadio6->SetStatic(TRUE); //Radio6 control is the leader of the group of Radio6 - 9
------------------------------------------------------------
Some GUIs of WinSail V2.0 have been updated, and you can download it again!
|
|
2006-9-20 05:04 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 98 楼』:
使用 LLM 解释/回答一下
(1)WinSail V2.0的全局控件句柄只有120个。
#define MAX_OBJECT_LIST_COUNT 120
(2)WinSail V2.0运行于实模式,受DOS的640K内存限制。
(3) 每一个窗口/对话框中的控件不限,受内存和全局控件句柄个数限制。
(1)There are only 120 global control handles in WinSail V2.0.
#define MAX_OBJECT_LIST_COUNT 120
(2)WinSail V2.0 runs in real mode and is subject to the 640K memory limit of DOS.
(3)There is no limit on the number of controls in each window/dialog box, which is subject to the memory and the number of global control handles.
|
|
2006-9-20 05:19 |
|
|
profree
中级用户
  
积分 478
发帖 132
注册 2003-7-2
状态 离线
|
『第 99 楼』:
使用 LLM 解释/回答一下
我的窗口需要使用下一步,上一步来完成,我想按下一步或上一步时,删除本窗口,重新生成新的窗口,我定义一个全局变量,在执行下一步时,先删除上一窗口,再生成新的窗口,但不成功,不知是为什么
My window needs to be completed using next step and previous step. When I want to press next step or previous step, I need to delete this window and regenerate a new window. I define a global variable. When executing next step, I first delete the previous window and then generate a new window, but it doesn't work. I don't know why.
|
|
2006-9-21 00:20 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 100 楼』:
使用 LLM 解释/回答一下
不能在本窗口的“控件”函数里面删除其父窗口。
只能发出窗口退出消息,可通过
void CloseWindow(CObject* pObj); -------- 窗口返回值为“IDCLOSE”
void ClickCloseButton(CObject* pObj); --- 窗口返回值为“IDCLOSE”
void ClickEnterButton(CObject* pObj); --- 窗口返回值为“IDOK”
void ClickCancelButton(CObject* pObj); -- 窗口返回值为“IDCANCEL”
void ClickYesButton(CObject* pObj); ----- 窗口返回值为“IDYES”
void ClickNoButton(CObject* pObj); ------ 窗口返回值为“IDNO”
void ClickRetryButton(CObject* pObj); --- 窗口返回值为“IDRETRY”
窗口消息循环函数为: int CWindow::PurseMessage();
对话框消息循环函数为:int CDialog::DoModal();
int CDialog::DoModal()的函数源代码为
int CDialog::DoModal()
{
return(CWindow::PurseMessage());
}
void ClickEnterButton(CObject* pObj)的函数源代码为
void ClickEnterButton(CObject* pObj)
{
::CloseWindow(pObj);
extern int nAfxMessageFlags;
nAfxMessageFlags = IDOK;
}
void ClickCancelButton(CObject* pObj)的函数源代码为
void ClickCancelButton(CObject* pObj)
{
::CloseWindow(pObj);
extern int nAfxMessageFlags;
nAfxMessageFlags = IDCANCEL;
}
You cannot delete its parent window inside the "control" function of this window.
Only the window exit message can be sent. It can be done through
void CloseWindow(CObject* pObj); -------- The window return value is "IDCLOSE"
void ClickCloseButton(CObject* pObj); --- The window return value is "IDCLOSE"
void ClickEnterButton(CObject* pObj); --- The window return value is "IDOK"
void ClickCancelButton(CObject* pObj); -- The window return value is "IDCANCEL"
void ClickYesButton(CObject* pObj); ----- The window return value is "IDYES"
void ClickNoButton(CObject* pObj); ------ The window return value is "IDNO"
void ClickRetryButton(CObject* pObj); --- The window return value is "IDRETRY"
The window message loop function is: int CWindow::PurseMessage();
The dialog box message loop function is: int CDialog::DoModal();
The function source code of int CDialog::DoModal() is
int CDialog::DoModal()
{
return(CWindow::PurseMessage());
}
The function source code of void ClickEnterButton(CObject* pObj) is
void ClickEnterButton(CObject* pObj)
{
::CloseWindow(pObj);
extern int nAfxMessageFlags;
nAfxMessageFlags = IDOK;
}
The function source code of void ClickCancelButton(CObject* pObj) is
void ClickCancelButton(CObject* pObj)
{
::CloseWindow(pObj);
extern int nAfxMessageFlags;
nAfxMessageFlags = IDCANCEL;
}
|
|
2006-9-21 21:28 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 101 楼』:
使用 LLM 解释/回答一下
int CWindow::PurseMessage()的函数源代码为
int CWindow::PurseMessage()
{
int nOldMessageFlags = nAfxMessageFlags; // 保护原值
nAfxMessageFlags = IDNULL; //刷新窗口退出标志
//......
//窗口消息循环
while (nAfxMessageFlags == IDNULL)
{
//....
}
//...
int nResult = nAfxMessageFlags;
nAfxMessageFlags = nOldMessageFlags; //恢复原值
return (nResult);
}
The source code of the function int CWindow::PurseMessage() is:
int CWindow::PurseMessage()
{
int nOldMessageFlags = nAfxMessageFlags; // Protect the original value
nAfxMessageFlags = IDNULL; // Refresh window exit flag
//......
// Window message loop
while (nAfxMessageFlags == IDNULL)
{
//....
}
//...
int nResult = nAfxMessageFlags;
nAfxMessageFlags = nOldMessageFlags; // Restore the original value
return (nResult);
}
|
|
2006-9-21 21:34 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 102 楼』:
发给一个实用的“向导”类
使用 LLM 解释/回答一下
/*
向导属性封装,由于WinSail受640K内存限制,可以这样来设计
(1)向“向导页”注册的页是函数,函数原型为
int far page(CObject* pObj);
对返回值要求
IDNO ------ 表示单击了“上一步”按钮
IDYES ----- 表示单击了“下一步”按钮
IDCANCEL -- 表示单击了“退出”按钮
(2)最多支持MAX_WIZARD_COUNT ( =10)个页
*/
#include <Symbol.h>
#include <Myframe.h>
#define MAX_WIZARD_COUNT 10
class CWizard
{
private:
int m_nOrder;
int m_nCount;
int far (*m_psFc[MAX_WIZARD_COUNT])(CObject *);
public:
BOOL AddDialog(int far (*pFc)(CObject*));
public:
int DoWizard();
public:
CWizard();
~CWizard();
};
CWizard::CWizard()
{
m_nOrder = 0;
m_nCount = 0;
for (int i = 0; i < MAX_WIZARD_COUNT; i++)
{
m_psFc[i] = NULL;
}
}
CWizard::~CWizard()
{
}
BOOL CWizard::AddDialog(int far (*pFc)(CObject *))
{
if (pFc == NULL || m_nCount >= MAX_WIZARD_COUNT)
{
return (FALSE);
}
m_psFc[m_nCount++] = pFc;
return (TRUE);
}
int CWizard::DoWizard()
{
//1 - IDNO -- Prev
//2 - IDYES -- Next
//3 - Cancel -- Cancel
int far (*pFc)(CObject *) = NULL;
int nResult = IDCLOSE;
while (1)
{
pFc = m_psFc[m_nOrder];
if (pFc == NULL)
{
break;
}
nResult = pFc(NULL);
if (nResult == IDNO)
{
if (m_nOrder > 0)
{
m_nOrder--;
}
continue;
}
else if (nResult == IDYES)
{
if (m_nOrder + 1 < m_nCount)
{
m_nOrder++;
}
continue;
}
break;
}
return (nResult);
}
```cpp
/*
Wizard property encapsulation. Since WinSail is limited by the 640K memory, it can be designed in this way
(1) The page registered to the "wizard page" is a function. The function prototype is
int far page(CObject* pObj);
Requirements for the return value
IDNO ------ means the "Previous" button is clicked
IDYES ----- means the "Next" button is clicked
IDCANCEL -- means the "Exit" button is clicked
(2) Up to MAX_WIZARD_COUNT ( =10) pages are supported
*/
#include <Symbol.h>
#include <Myframe.h>
#define MAX_WIZARD_COUNT 10
class CWizard
{
private:
int m_nOrder;
int m_nCount;
int far (*m_psFc)(CObject *);
public:
BOOL AddDialog(int far (*pFc)(CObject*));
public:
int DoWizard();
public:
CWizard();
~CWizard();
};
CWizard::CWizard()
{
m_nOrder = 0;
m_nCount = 0;
for (int i = 0; i < MAX_WIZARD_COUNT; i++)
{
m_psFc = NULL;
}
}
CWizard::~CWizard()
{
}
BOOL CWizard::AddDialog(int far (*pFc)(CObject *))
{
if (pFc == NULL || m_nCount >= MAX_WIZARD_COUNT)
{
return (FALSE);
}
m_psFc = pFc;
return (TRUE);
}
int CWizard::DoWizard()
{
//1 - IDNO -- Previous
//2 - IDYES -- Next
//3 - Cancel -- Cancel
int far (*pFc)(CObject *) = NULL;
int nResult = IDCLOSE;
while (1)
{
pFc = m_psFc;
if (pFc == NULL)
{
break;
}
nResult = pFc(NULL);
if (nResult == IDNO)
{
if (m_nOrder > 0)
{
m_nOrder--;
}
continue;
}
else if (nResult == IDYES)
{
if (m_nOrder + 1 < m_nCount)
{
m_nOrder++;
}
continue;
}
break;
}
return (nResult);
}
```
|
|
2006-9-21 23:53 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 103 楼』:
使用 LLM 解释/回答一下
将CWizard::AddDialog()函数改名为CWizard::AddPage()函数
现举例如下:
#include <Symbol.h>
#include <MyFrame.h>
int far Page1(CObject* pCurObj)
{
//Create a Dialog On the Center of Desktop
CDialog* pDialog = new CDialog;//分配实例
pDialog->CreateWindow(0, 0, 321, 240, "第一页:1");//建立窗口
pDialog->Center();//窗口对中
//Create Close's Button Control
CCloseButton* pCloseButton = new CCloseButton(pDialog);//分配和建立关闭按钮
//Create a Button Control
CButton* pButton1 = new CButton(pDialog);
pButton1->CreateObject(10, 199, 93, 24, "上一步(\x3P\x3)");
pButton1->SetShortcutKey(VK_ALT_P);
pButton1->SetFc(ClickNoButton);
//Create a Button Control
CButton* pButton2 = new CButton(pDialog);
pButton2->CreateObject(111, 199, 93, 24, "下一步(\x3N\x3)");
pButton2->SetShortcutKey(VK_ALT_N);
pButton2->SetFc(ClickYesButton);
//Create a Button Control
CButton* pButton3 = new CButton(pDialog);
pButton3->CreateObject(211, 199, 93, 24, "退出(\x3\C\x3)");
pButton3->SetShortcutKey(VK_ALT_C);
pButton3->SetFc(ClickCancelButton);
//Create Radio Control
CRadio* pRadio1 = new CRadio(pDialog);
pRadio1->CreateObject(28, 59, 57, 24, "男姓");
pRadio1->SetStatic(TRUE);
pRadio1->SetRadio(TRUE);
pRadio1->SetID(RADIOBASE + 1 - 1);
//Create Radio Control
CRadio* pRadio2 = new CRadio(pDialog);
pRadio2->CreateObject(100, 61, 57, 24, "女性");
pRadio2->SetID(RADIOBASE + 2 - 1);
//Create Radio Control
CRadio* pRadio3 = new CRadio(pDialog);
pRadio3->CreateObject(171, 61, 57, 24, "保密");
pRadio3->SetID(RADIOBASE + 3 - 1);
//Create Radio Control
CRadio* pRadio4 = new CRadio(pDialog);
pRadio4->CreateObject(28, 148, 57, 24, "大专");
pRadio4->SetStatic(TRUE);
pRadio4->SetRadio(TRUE);
pRadio4->SetID(RADIOBASE + 4 - 1);
//Create Radio Control
CRadio* pRadio5 = new CRadio(pDialog);
pRadio5->CreateObject(100, 148, 57, 24, "本科");
pRadio5->SetID(RADIOBASE + 5 - 1);
//Create Radio Control
CRadio* pRadio6 = new CRadio(pDialog);
pRadio6->CreateObject(169, 148, 57, 24, "硕士");
pRadio6->SetID(RADIOBASE + 6 - 1);
//Create Radio Control
CRadio* pRadio7 = new CRadio(pDialog);
pRadio7->CreateObject(229, 147, 57, 24, "博士");
pRadio7->SetID(RADIOBASE + 7 - 1);
//Create Group Control
CStatic* pGroup1 = new CStatic(pDialog);
pGroup1->CreateObject(10, 29, 285, 67, "性别");
//Create Group Control
CStatic* pGroup2 = new CStatic(pDialog);
pGroup2->CreateObject(10, 118, 285, 66, "学位");
//Show Window
pDialog->ShowWindow();//显示窗口
//go into Message Loop
int nResult = pDialog->DoModal();//进入窗口消息循环
//Destroy Window
delete pDialog;//删除对话框
return (nResult);
}
int far Page2(CObject* pCurObj)
{
//Create a Dialog On the Center of Desktop
CDialog* pDialog = new CDialog;//分配实例
pDialog->CreateWindow(0, 0, 321, 240, "第二页:2");//建立窗口
pDialog->Center();//窗口对中
//Create Close's Button Control
CCloseButton* pCloseButton = new CCloseButton(pDialog);//分配和建立关闭按钮
//Create a Button Control
CButton* pButton1 = new CButton(pDialog);
pButton1->CreateObject(10, 199, 93, 24, "上一步(\x3P\x3)");
pButton1->SetShortcutKey(VK_ALT_P);
pButton1->SetFc(ClickNoButton);
//Create a Button Control
CButton* pButton2 = new CButton(pDialog);
pButton2->CreateObject(111, 199, 93, 24, "下一步(\x3N\x3)");
pButton2->SetShortcutKey(VK_ALT_N);
pButton2->SetFc(ClickYesButton);
//Create a Button Control
CButton* pButton3 = new CButton(pDialog);
pButton3->CreateObject(211, 199, 93, 24, "退出(\x3\C\x3)");
pButton3->SetShortcutKey(VK_ALT_C);
pButton3->SetFc(ClickCancelButton);
//Create Radio Control
CRadio* pRadio1 = new CRadio(pDialog);
pRadio1->CreateObject(28, 64, 57, 24, "北京");
pRadio1->SetStatic(TRUE);
pRadio1->SetRadio(TRUE);
pRadio1->SetID(RADIOBASE + 1 - 1);
//Create Radio Control
CRadio* pRadio2 = new CRadio(pDialog);
pRadio2->CreateObject(100, 65, 57, 24, "上海");
pRadio2->SetID(RADIOBASE + 2 - 1);
//Create Radio Control
CRadio* pRadio3 = new CRadio(pDialog);
pRadio3->CreateObject(171, 65, 57, 24, "广州");
pRadio3->SetID(RADIOBASE + 3 - 1);
//Create Combo Control
CComboBox* pComboBox1 = new CComboBox(pDialog);
pComboBox1->CreateCombo(124, 122, 169, 24, NULL);
pComboBox1->SetID(COMBOBASE + 1 - 1);
//Create Group Control
CStatic* pGroup1 = new CStatic(pDialog);
pGroup1->CreateObject(10, 34, 285, 67, "籍贯");
//Create a Label Control
CLabel* pLabel1 = new CLabel(pDialog);
pLabel1->CreateObject(13, 125, 67, 12, "选择年份(N)");
//Show Window
pDialog->ShowWindow();//显示窗口
//go into Message Loop
int nResult = pDialog->DoModal();//进入窗口消息循环
//Destroy Window
delete pDialog;//删除对话框
return (nResult);
}
int far Page3(CObject* pCurObj)
{
//Create a Dialog On the Center of Desktop
CDialog* pDialog = new CDialog;//分配实例
pDialog->CreateWindow(0, 0, 321, 240, "第三页:3");//建立窗口
pDialog->Center();//窗口对中
//Create Close's Button Control
CCloseButton* pCloseButton = new CCloseButton(pDialog);//分配和建立关闭按钮
//Create a Button Control
CButton* pButton1 = new CButton(pDialog);
pButton1->CreateObject(10, 199, 93, 24, "上一步(\x3P\x3)");
pButton1->SetShortcutKey(VK_ALT_P);
pButton1->SetFc(ClickNoButton);
//Create a Button Control
CButton* pButton2 = new CButton(pDialog);
pButton2->CreateObject(111, 199, 93, 24, "下一步(\x3N\x3)");
pButton2->SetShortcutKey(VK_ALT_N);
pButton2->SetFc(ClickYesButton);
//Create a Button Control
CButton* pButton3 = new CButton(pDialog);
pButton3->CreateObject(211, 199, 93, 24, "退出(\x3\C\x3)");
pButton3->SetShortcutKey(VK_ALT_C);
pButton3->SetFc(ClickCancelButton);
//Create Slider Control
CSliderCtrl* pSliderCtrl1 = new CSliderCtrl(pDialog);
pSliderCtrl1->CreateObject(37, 153, 241, 24, NULL);
pSliderCtrl1->SetID(SLIDERBASE + 1 - 1);
pSliderCtrl1->SetHorz(TRUE);
//Create Slider Control
CSliderCtrl* pSliderCtrl2 = new CSliderCtrl(pDialog);
pSliderCtrl2->CreateObject(138, 38, 30, 111, NULL);
pSliderCtrl2->SetID(SLIDERBASE + 2 - 1);
pSliderCtrl2->SetHorz(FALSE);
//Show Window
pDialog->ShowWindow();//显示窗口
//go into Message Loop
int nResult = pDialog->DoModal();//进入窗口消息循环
//Destroy Window
delete pDialog;//删除对话框
return(nResult);
}
void DemoWizard()
{
CWizard *pWizard = new CWizard;
pWizard->AddPage (Page1);
pWizard->AddPage (Page2);
pWizard->AddPage (Page3);
pWizard->DoWizard();
DELETE(pWizard);
}
Rename the CWizard::AddDialog() function to the CWizard::AddPage() function.
The example is as follows:
#include <Symbol.h>
#include <MyFrame.h>
int far Page1(CObject* pCurObj)
{
//Create a Dialog On the Center of Desktop
CDialog* pDialog = new CDialog;//Allocate instance
pDialog->CreateWindow(0, 0, 321, 240, "Page 1: 1");//Create window
pDialog->Center();//Center the window
//Create Close's Button Control
CCloseButton* pCloseButton = new CCloseButton(pDialog);//Allocate and create close button
//Create a Button Control
CButton* pButton1 = new CButton(pDialog);
pButton1->CreateObject(10, 199, 93, 24, "Previous step(\x3P\x3)");
pButton1->SetShortcutKey(VK_ALT_P);
pButton1->SetFc(ClickNoButton);
//Create a Button Control
CButton* pButton2 = new CButton(pDialog);
pButton2->CreateObject(111, 199, 93, 24, "Next step(\x3N\x3)");
pButton2->SetShortcutKey(VK_ALT_N);
pButton2->SetFc(ClickYesButton);
//Create a Button Control
CButton* pButton3 = new CButton(pDialog);
pButton3->CreateObject(211, 199, 93, 24, "Exit(\x3\C\x3)");
pButton3->SetShortcutKey(VK_ALT_C);
pButton3->SetFc(ClickCancelButton);
//Create Radio Control
CRadio* pRadio1 = new CRadio(pDialog);
pRadio1->CreateObject(28, 59, 57, 24, "Male");
pRadio1->SetStatic(TRUE);
pRadio1->SetRadio(TRUE);
pRadio1->SetID(RADIOBASE + 1 - 1);
//Create Radio Control
CRadio* pRadio2 = new CRadio(pDialog);
pRadio2->CreateObject(100, 61, 57, 24, "Female");
pRadio2->SetID(RADIOBASE + 2 - 1);
//Create Radio Control
CRadio* pRadio3 = new CRadio(pDialog);
pRadio3->CreateObject(171, 61, 57, 24, "保密");
pRadio3->SetID(RADIOBASE + 3 - 1);
//Create Radio Control
CRadio* pRadio4 = new CRadio(pDialog);
pRadio4->CreateObject(28, 148, 57, 24, "Associate degree");
pRadio4->SetStatic(TRUE);
pRadio4->SetRadio(TRUE);
pRadio4->SetID(RADIOBASE + 4 - 1);
//Create Radio Control
CRadio* pRadio5 = new CRadio(pDialog);
pRadio5->CreateObject(100, 148, 57, 24, "Bachelor's degree");
pRadio5->SetID(RADIOBASE + 5 - 1);
//Create Radio Control
CRadio* pRadio6 = new CRadio(pDialog);
pRadio6->CreateObject(169, 148, 57, 24, "Master's degree");
pRadio6->SetID(RADIOBASE + 6 - 1);
//Create Radio Control
CRadio* pRadio7 = new CRadio(pDialog);
pRadio7->CreateObject(229, 147, 57, 24, "Doctoral degree");
pRadio7->SetID(RADIOBASE + 7 - 1);
//Create Group Control
CStatic* pGroup1 = new CStatic(pDialog);
pGroup1->CreateObject(10, 29, 285, 67, "Gender");
//Create Group Control
CStatic* pGroup2 = new CStatic(pDialog);
pGroup2->CreateObject(10, 118, 285, 66, "Degree");
//Show Window
pDialog->ShowWindow();//Show window
//go into Message Loop
int nResult = pDialog->DoModal();//Enter window message loop
//Destroy Window
delete pDialog;//Delete dialog box
return (nResult);
}
int far Page2(CObject* pCurObj)
{
//Create a Dialog On the Center of Desktop
CDialog* pDialog = new CDialog;//Allocate instance
pDialog->CreateWindow(0, 0, 321, 240, "Page 2: 2");//Create window
pDialog->Center();//Center the window
//Create Close's Button Control
CCloseButton* pCloseButton = new CCloseButton(pDialog);//Allocate and create close button
//Create a Button Control
CButton* pButton1 = new CButton(pDialog);
pButton1->CreateObject(10, 199, 93, 24, "Previous step(\x3P\x3)");
pButton1->SetShortcutKey(VK_ALT_P);
pButton1->SetFc(ClickNoButton);
//Create a Button Control
CButton* pButton2 = new CButton(pDialog);
pButton2->CreateObject(111, 199, 93, 24, "Next step(\x3N\x3)");
pButton2->SetShortcutKey(VK_ALT_N);
pButton2->SetFc(ClickYesButton);
//Create a Button Control
CButton* pButton3 = new CButton(pDialog);
pButton3->CreateObject(211, 199, 93, 24, "Exit(\x3\C\x3)");
pButton3->SetShortcutKey(VK_ALT_C);
pButton3->SetFc(ClickCancelButton);
//Create Radio Control
CRadio* pRadio1 = new CRadio(pDialog);
pRadio1->CreateObject(28, 64, 57, 24, "Beijing");
pRadio1->SetStatic(TRUE);
pRadio1->SetRadio(TRUE);
pRadio1->SetID(RADIOBASE + 1 - 1);
//Create Radio Control
CRadio* pRadio2 = new CRadio(pDialog);
pRadio2->CreateObject(100, 65, 57, 24, "Shanghai");
pRadio2->SetID(RADIOBASE + 2 - 1);
//Create Radio Control
CRadio* pRadio3 = new CRadio(pDialog);
pRadio3->CreateObject(171, 65, 57, 24, "Guangzhou");
pRadio3->SetID(RADIOBASE + 3 - 1);
//Create Combo Control
CComboBox* pComboBox1 = new CComboBox(pDialog);
pComboBox1->CreateCombo(124, 122, 169, 24, NULL);
pComboBox1->SetID(COMBOBASE + 1 - 1);
//Create Group Control
CStatic* pGroup1 = new CStatic(pDialog);
pGroup1->CreateObject(10, 34, 285, 67, "Native place");
//Create a Label Control
CLabel* pLabel1 = new CLabel(pDialog);
pLabel1->CreateObject(13, 125, 67, 12, "Select year(N)");
//Show Window
pDialog->ShowWindow();//Show window
//go into Message Loop
int nResult = pDialog->DoModal();//Enter window message loop
//Destroy Window
delete pDialog;//Delete dialog box
return (nResult);
}
int far Page3(CObject* pCurObj)
{
//Create a Dialog On the Center of Desktop
CDialog* pDialog = new CDialog;//Allocate instance
pDialog->CreateWindow(0, 0, 321, 240, "Page 3: 3");//Create window
pDialog->Center();//Center the window
//Create Close's Button Control
CCloseButton* pCloseButton = new CCloseButton(pDialog);//Allocate and create close button
//Create a Button Control
CButton* pButton1 = new CButton(pDialog);
pButton1->CreateObject(10, 199, 93, 24, "Previous step(\x3P\x3)");
pButton1->SetShortcutKey(VK_ALT_P);
pButton1->SetFc(ClickNoButton);
//Create a Button Control
CButton* pButton2 = new CButton(pDialog);
pButton2->CreateObject(111, 199, 93, 24, "Next step(\x3N\x3)");
pButton2->SetShortcutKey(VK_ALT_N);
pButton2->SetFc(ClickYesButton);
//Create a Button Control
CButton* pButton3 = new CButton(pDialog);
pButton3->CreateObject(211, 199, 93, 24, "Exit(\x3\C\x3)");
pButton3->SetShortcutKey(VK_ALT_C);
pButton3->SetFc(ClickCancelButton);
//Create Slider Control
CSliderCtrl* pSliderCtrl1 = new CSliderCtrl(pDialog);
pSliderCtrl1->CreateObject(37, 153, 241, 24, NULL);
pSliderCtrl1->SetID(SLIDERBASE + 1 - 1);
pSliderCtrl1->SetHorz(TRUE);
//Create Slider Control
CSliderCtrl* pSliderCtrl2 = new CSliderCtrl(pDialog);
pSliderCtrl2->CreateObject(138, 38, 30, 111, NULL);
pSliderCtrl2->SetID(SLIDERBASE + 2 - 1);
pSliderCtrl2->SetHorz(FALSE);
//Show Window
pDialog->ShowWindow();//Show window
//go into Message Loop
int nResult = pDialog->DoModal();//Enter window message loop
//Destroy Window
delete pDialog;//Delete dialog box
return(nResult);
}
void DemoWizard()
{
CWizard *pWizard = new CWizard;
pWizard->AddPage (Page1);
pWizard->AddPage (Page2);
pWizard->AddPage (Page3);
pWizard->DoWizard();
DELETE(pWizard);
}
|
|
2006-9-21 23:58 |
|
|
profree
中级用户
  
积分 478
发帖 132
注册 2003-7-2
状态 离线
|
『第 104 楼』:
使用 LLM 解释/回答一下
非常感谢firstsail的热心帮助!
这几天一直在看winsail的资料,现有几个建议:
一、好像winsail没有驱动器列表,选项卡控件和数值增减控件,不知firstsail能否加入
二、本人以前也反映过firstsail的界面和控件的美观问题,firstsail能否再考虑
前久下载了chicago9的源代码(全部为源代码),里面有可执行文件,包括驱winsail没有动器列表控件,数值增减控件等控件,运行截图如下:

建议firstsail能取其长处,这个文件可以到网上下载,或需要的话我可以上传
Last edited by profree on 2006-9-23 at 02:32 ]
Thanks a lot for the enthusiastic help from firstsail!
I've been looking at the materials of winsail these days. There are several suggestions:
1. It seems that winsail doesn't have a drive list, tab controls, and spin controls. I wonder if firstsail can add them.
2. I also reflected on the issue of the interface and control aesthetics of firstsail before. I wonder if firstsail can consider it again.
I downloaded the source code of chicago9 (all source codes) a while ago. There are executable files in it, including controls like the drive list control and spin control that winsail doesn't have. The running screenshots are as follows:

It is suggested that firstsail can take its advantages. This file can be downloaded online, or I can upload it if needed.
Last edited by profree on 2006-9-23 at 02:32 ]
|
|
2006-9-23 00:09 |
|
|
firstsail
高级用户
   
积分 668
发帖 295
注册 2005-7-26 来自 广东深圳
状态 离线
|
『第 105 楼』:
使用 LLM 解释/回答一下
WinSail V2.0内核已经重新上传。
(1) 演示程序所在的目录是“Sail3000”
(2)“向导”类已经被“WinSail”内核支持。
(3)“向导”类的详细设计文档名为“界面非控件类_CWizard向导类详细设计.doc”
(4)“向导”演示模块在“sail3000\Wizard2.cpp”文件
(5) 可在Win98,Windows2000,WindowsXP运行Sail3000\sail2000.exe可执行文件。
(6) 鼠标只能在“Win98”或“纯DOS”下显示。
所有用WinSail V2.0开发出来的界面,只要按下“F3”功能键,就自动会将当前窗口的画
面以256色的“a.bmp”文件形式记录下来,方便写说明书。
The kernel of WinSail V2.0 has been re-uploaded.
(1) The directory where the demo program is located is "Sail3000"
(2) The "wizard" class is already supported by the "WinSail" kernel.
(3) The detailed design document of the "wizard" class is named "Interface Non-Control Class_CWizard Wizard Class Detailed Design.doc"
(4) The "wizard" demo module is in the "sail3000\Wizard2.cpp" file
(5) The Sail3000\sail2000.exe executable file can be run on Win98, Windows2000, and WindowsXP.
(6) The mouse can only be displayed under "Win98" or "pure DOS".
For all interfaces developed with WinSail V2.0, as long as the "F3" function key is pressed, the screen of the current window will be automatically recorded as a 256-color "a.bmp" file, which is convenient for writing instructions.
|
|
2006-9-23 06:04 |
|
|