China DOS Union

-- Unite DOS · Advance DOS · Grow DOS --

Union site: www.cn-dos.net Forum site: www.cn-dos.net/forum
DOS stands for freedom, openness and progress. Let us work hard, learn from the openness and GNU spirit of FreeDOS and Linux, and together build and grow a free GNU GPL world!

中国DOS联盟论坛
The time now is 2026-06-24 07:33
中国DOS联盟论坛 » DOS开发编程 & 发展交流 (开发室) » The Terminator of DOS Interface Development View 94,227 Replies 290
Floor 121 Posted 2006-09-28 21:43 ·  中国 云南 红河哈尼族彝族自治州 电信
中级用户
★★
Credits 478
Posts 132
Joined 2003-07-02 00:00
22-year member
UID 6296
Gender Male
Status Offline
Indeed, the BMP pictures displayed now are much better and don't change colors.

1. Add the setting of the default item, that is, the default item executed when pressing Enter.
2. Modify the current radio box/check box item - press the hotkey to be selected.
3. The BMP file can be changed in size when displayed, and there can be two ways, clipping or zooming.
Floor 122 Posted 2006-09-29 03:15 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
20-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
WinSail V2.0 has been re-uploaded --- 2006-09-28 15:30

Added the "default" property of the button control. The function is
CButton::SetDefaultFlags(BOOL bFlags);
Floor 123 Posted 2006-09-29 04:11 ·  中国 云南 红河哈尼族彝族自治州 个旧市 电信
中级用户
★★
Credits 478
Posts 132
Joined 2003-07-02 00:00
22-year member
UID 6296
Gender Male
Status Offline
Boss, thank you so much.

I used to put the items to be defaulted at the front before, now it's much more convenient.

1. Can you talk about how to use the scroll bar control, for example, in a list box control or a multi-line edit box control?
2. After the slide bar control, the increment control, and the edit control are "bound", how can we ensure the consistency of the three?
3. How to set the default value and "step size" of the slide bar control?
4. How to set the progress bar to be equal-time?
5. Can the smooth option be added to the performance of the progress bar? The current one is blocky.

[ Last edited by profree on 2006-9-29 at 04:15 ]
Floor 124 Posted 2006-09-29 06:37 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
20-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
Question: (1) How to set the default value and "step size" of the slider control
Answer:
//Set the range of the slider, which is equivalent to "step size"
CSliderCtrl::SetRange(DWORD dwMin, DOWRD dwMax)

//Get the range of the slider
CSliderCtrl::GetRange(DWORD* pdwMin, DOWRD* pdwMax)

//Set the position of the slider
CSliderCtrl::SetPos(int nPos)

//Get the position of the slider
CSliderCtrl::GetPos()

Question: (2) How to set equal time for the progress bar
Answer:
There is no so-called time interval attribute for the "progress bar".

//Set the range of the progress bar, which is equivalent to "step size"
CSliderCtrl::SetRange(DWORD dwMin, DOWRD dwMax)

//Get the range of the progress bar slider
CSliderCtrl::GetRange(DWORD* pdwMin, DOWRD* pdwMax)

//Set the position of the progress bar
CSliderCtrl::SetPos(int nPos)

//Get the position of the progress bar
CSliderCtrl::GetPos()

The word for progress bar should be "CProgressCtrl", there was a mistake here, it will be corrected later!
Floor 125 Posted 2006-09-29 06:39 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
20-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
The above post should be as follows:

Question: (1) How to set the default value and "step size" of the slider control
Answer:
//Set the range of the slider, equivalent to "step size"
CSliderCtrl::SetRange(DWORD dwMin, DOWRD dwMax)

//Get the range of the slider
CSliderCtrl::GetRange(DWORD* pdwMin, DOWRD* pdwMax)

//Set the position of the slider
CSliderCtrl::SetPos(int nPos)

//Get the position of the slider
CSliderCtrl::GetPos()

Question: (2) How to set an equal-time progress bar
Answer:
There is no so-called time interval attribute for the "progress bar".

//Set the range of the progress bar, equivalent to "step size"
CProcessCtrl::SetRange(DWORD dwMin, DOWRD dwMax)

//Get the range of the progress bar slider
CProcessCtrl::GetRange(DWORD* pdwMin, DOWRD* pdwMax)

//Set the position of the progress bar
CProcessCtrl::SetPos(int nPos)

//Get the position of the progress bar
CProcessCtrl::GetPos()

The word "progress bar" should be "CProgressCtrl", there is an error here, it will be corrected later!
Floor 126 Posted 2006-09-29 06:57 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
20-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
(1) Usage of Horizontal Scroll Bar CHScrollBar()
<1> Allocate instance
<2> Create scroll bar
<3> Set the range of the scroll bar
<4> Set the default value of the scroll bar
<5> Register the event of clicking "left button of the scroll bar"
<6> Register the event of clicking "middle button of the scroll bar for dragging"
<7> Register the event of dragging "left button of the scroll bar"
<7> Assign an ID number to the scroll bar that does not conflict with other controls


void far ClickScroll_Left(CHScrollBar* pScroll)
{
CDialog* pDialog = (CDialog *)pScroll->GetParent();
//....
}

void far ClickScroll_Pos(CHScrollBar* pScroll)
{
CDialog* pDialog = (CDialog *)pScroll->GetParent();
//....
}

void far ClickScroll_Right(CHScrollBar* pScroll)
{
CDialog* pDialog = (CDialog *)pScroll->GetParent();
//....
}

//...


CHScrollBar *pScrollBarH1 = new CHScrollBar(pDialog); // Allocate instance
pScrollBarH1->CreateScrollBar(100, 100, // Create scroll bar
180, SCROLL_BAR_WIDTH, NULL);
pScrollBarH1->SetRange(0, 10); // Set range
pScrollBarH1->SetPos(5); // Set default value
pScrollBarH1->SetScrollLeftRc(); // Register "click left button" event
pScrollBarH1->SetScrollPosRc();// Register "drag middle button" event
pScrollBarH1->SetScrollRightRc();// Register "click right button" event
pScrollBarH1->SetID(HSCROLLBASE + 1 - 1); // Set ID number
Floor 127 Posted 2006-09-29 06:58 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
20-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
CHScrollBar *pScrollBarH1 = new CHScrollBar(pDialog); // Allocate instance
pScrollBarH1->CreateScrollBar(100, 100, // Create scroll bar
180, SCROLL_BAR_WIDTH, NULL);
pScrollBarH1->SetRange(0, 10); // Set range
pScrollBarH1->SetPos(5); // Set default value
pScrollBarH1->SetScrollLeftRc(::ClickScroll_Left); // Register "click left button" event
pScrollBarH1->SetScrollPosRc(::ClickScroll_Pos); // Register "drag middle button" event
pScrollBarH1->SetScrollRightRc(::ClickScroll_Right); // Register "click right button" event
pScrollBarH1->SetID(HSCROLLBASE + 1 - 1); // Set ID number
Floor 128 Posted 2006-09-29 07:11 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
20-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
When the "left button" of the horizontal scroll bar is clicked, the scroll bar will return the message macro "VK_SCROLL_LEFT" to the upper-level control.

When the "middle button" of the horizontal scroll bar is dragged, the scroll bar will return the message macro "VK_SCROLL_HORZ_POS" to the upper-level control.

When the "left button" of the horizontal scroll bar is clicked, the scroll bar will return the message macro "VK_SCROLL_RIGHT" to the upper-level control.

When the "up button" of the vertical scroll bar is clicked, the scroll bar will return the message macro "VK_SCROLL_UP" to the upper-level control.

When the "middle button" of the vertical scroll bar is dragged, the scroll bar will return the message macro "VK_SCROLL_VERT_POS" to the upper-level control.

When the "down button" of the vertical scroll bar is clicked, the scroll bar will return the message macro "VK_SCROLL_DOWN" to the upper-level control.
Floor 129 Posted 2006-09-29 07:15 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
20-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
(1) The virtual function int CObject::SWapping() is the message loop pump for all controls.
(2) The window message loop is to continuously call the Swapping() function of the focused control.
Floor 130 Posted 2006-09-29 07:24 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
20-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
The source code of the message pump Swapping() function of the control base class CObject is as follows

int CObject::DefaultSwapping()
{
int nKey = 0;
int nX , nY;

if (AfxKbhit())
{
nKey = ::bioskey(0);
}

if (nKey != 0)
{
return (nKey);
}

::IsMouseDown(MOUSE_LEFT);
nX = ::GetMouseX();
nY = ::GetMouseY();

if ((SystemMouse.statue & MOUSE_LEFT) == MOUSE_LEFT)
{
if (this->IsClientRect(nX, nY))
{
nKey = VK_MOUSE_DOWN_LEFT;
}
else if (this->IsScreenRect(nX, nY))
{
nKey = VK_MOUSE_CLIENT_OUT;
if ((m_dwSort & WINDOW_SORT) != WINDOW_SORT)
{
nKey = 0;
}
}
else
{
nKey = VK_MOUSE_SCREEN_OUT;
}
}
else if ((SystemMouse.statue & MOUSE_RIGHT) == MOUSE_RIGHT)
{
if (this->IsClientRect(nX, nY))
{
nKey = VK_MOUSE_DOWN_RIGHT;
}
else if (this->IsScreenRect(nX, nY))
{
nKey = VK_MOUSE_CLIENT_OUT;
if ((m_dwSort & WINDOW_SORT) != WINDOW_SORT)
{
nKey = 0;
}
}
else
{
nKey = VK_MOUSE_SCREEN_OUT;
}

}

if (nKey != 0)
{
return (nKey);
}

nKey = this->VirtualKeyboard();

return(nKey);

}

int CObject::Swapping()
{
return(this->DefaultSwapping());

}
Floor 131 Posted 2006-09-29 22:12 ·  中国 云南 红河哈尼族彝族自治州 个旧市 电信
中级用户
★★
Credits 478
Posts 132
Joined 2003-07-02 00:00
22-year member
UID 6296
Gender Male
Status Offline
I. There is a problem with the SetDefaultFlags function. When a certain item is set as the default, and then you use the Tab key to move the focus to another item and then press Enter, the item that is executed is not the one with the focus but the default item set, which is inconsistent with the operation of the Windows dialog boxes we are currently using.

II. Regarding the response problem of mouse actions, it should be that the mouse is pressed until released (it should be "release" instead of the current "press"). For example, on a button, you should press the left mouse button inside the button and then release it. Of course, the range should also be within the button range. If it is released outside the button range, the operation is invalid.
Floor 132 Posted 2006-09-30 01:20 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
20-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
WinSail has been re-uploaded on 2006-09-29 13:00

(1) SetDefaultFlags() has been re-"fixed"

(2) The name of the "progress bar" class has been changed from "CProcessCtrl" to the correct "CProgressCtrl"
Floor 133 Posted 2006-09-30 04:25 ·  中国 云南 红河哈尼族彝族自治州 电信
中级用户
★★
Credits 478
Posts 132
Joined 2003-07-02 00:00
22-year member
UID 6296
Gender Male
Status Offline
Keep in sync with the "official" at any time.

Where is the font set? The display properties set in the config.sys file take effect, but the set font doesn't work. I can only change the font to the default display.fon
Floor 134 Posted 2006-09-30 04:49 ·  中国 广东 深圳 电信
高级用户
★★
Credits 668
Posts 295
Joined 2005-07-26 00:00
20-year member
UID 41110
Gender Male
From 广东深圳
Status Offline
To Profree:

Due to historical reasons, the Font key in the [Display] section of the Config.Sys file is a "boolean value" and needs to be upgraded to a "string" type. It is planned to update WinSail before tomorrow morning.

For example:

[Display]
Font = "Font\DisplayX.Fon" ; Use Songti

Please tell me what the Chinese names of the font libraries hzk16C, Hzk16F, HZK16H, HZK16K, HZK16L, HZK16S, HZK16V, HZK16X, HZK16Y are
Floor 135 Posted 2006-09-30 05:14 ·  中国 云南 红河哈尼族彝族自治州 电信
中级用户
★★
Credits 478
Posts 132
Joined 2003-07-02 00:00
22-year member
UID 6296
Gender Male
Status Offline
My understanding is as follows:
Hzk16F--FangSong (SimSun)
HZK16H--HeiTi (Black)
HZK16K--KaiTi (Cursive)
HZK16L--LiShu (Official Script)
HZK16S--SongTi (Serif)
HZK16X--XiYuan (Thin Circle)
HZK16Y--YouYuan (Young Circle)

The font is downloaded here, and there are also instructions:
http://www.cn-dos.net/forum/viewthread.php?tid=18934
‹ Prev 1 7 8 9 10 11 20 Next ›
Forum Jump: