 |
|
 |
Hi,
Please excuse me for this simple question. I have been trying this for a while now but still I dont know that How Do I Access Controls From Other Tabs?
Thnx for your reply.
This world is going to explode due to international politics, SOON.
|
|
|
|
 |
|
 |
Thank you very much~I have been finding this Solution for a long time, finally I got it here ~thanks your example again~ I am a Chinese C++ developer~ O_o
|
|
|
|
 |
|
 |
Thank you, it just works like a charm.
|
|
|
|
 |
|
 |
are they any minimal width to the cproperty page using scrollable propertypage.?
i cannot have a cproperty page width rather than 320 pixels..
i tried different thing, but can't reduce width..
help granted please..
|
|
|
|
 |
|
 |
Good Work Jemin,
This is a very handy trick. Especially developing applications for different resolutions 800x600, 640x480, and having lots of options to be populated in property pages.
My 5/5 Vote!
Thanks,
Suchit.
|
|
|
|
 |
|
 |
I downloaded the demo and noticed that when I incorporated
it into a project, that when I click on the scroll bars, the
screen looks blank. If I click again, Im back at the top and
then can scroll down.
Any idea on how to prevent it from looking blank when the
scroll bar is clicked on?
Please, any response you can give me will be greatly appreciated.
Sincerely,
Danielle Brina (an overworked graduate student)
|
|
|
|
 |
|
 |
Hi all
in my application in embedded Visual C++, I have several CPropertyPage. in some of these property pages, I have a numerical edit box. on InitDialoge() of each page, I initialize these numerical fields with siutable numbers. But when my program runs and I want to enter every property pages with numerical fields, I get always an error: "Please enter an integer". But why?! I already intialized these fields with siutable numbers! Any idea?
Thanks!
|
|
|
|
 |
|
 |
Hi,
In your example, you determine the size of the property page in the resource file. Is it possible to choose the size at runtime, for example, by modifying the resource template loaded in memory ?
Thank you for your reply.
Regards,
Xavier
|
|
|
|
 |
|
 |
Thanx for scrollable property page. But we can not use tab keys to navigate. Though the control has the focus, scrolling is required to make it visible
Can any one please tell the solution.
Thanx in advance
|
|
|
|
 |
|
 |
I'm trying to solve this poblem now...
I've allready wrote a huge application. And only now noticed this problem.
So, it's no way back. I have to find the solution...
|
|
|
|
 |
|
 |
Trap the VK_TAB in MFC I think inside PretranslateMessage. And check the position of the control that received focus. If it is hidden just send message WM_VSCROLL to the parent.
...
CheckCtrlNewFocus()
{
HWND hWnd=::GetFocus();
HWND hParent=::GetParent(hWnd);
BOOL bVScroll = (::GetWindowLong(hParent, GWL_STYLE) &WS_VSCROLL)!=0;
if (!bVScroll)
return 0;
/* check if the control is visible */
RECT oRectClient;
/* this is to calculate client's rect relative to parent */
ISEGetClientRect(&oRectClient, (long) hWnd);
SCROLLINFO si = {sizeof(si)};
si.cbSize = sizeof(SCROLLINFO);
si.fMask = SIF_PAGE | SIF_POS | SIF_RANGE | SIF_TRACKPOS;
::GetScrollInfo(hParent, SB_VERT, &si);
if (oRectClient.bottom>si.nTrackPos)
{
::SendMessageA(hParent, WM_VSCROLL, SB_PAGEDOWN, 0);
}
return 0;
}
|
|
|
|
 |
|
 |
Is it possible to place these property sheets vertically instead of the usual horizontal way on the top of the window?
|
|
|
|
 |
|
 |
Hi, thx for very helpful post. It works nice under "big" Windows, but I couldn't obtain that result on my iPAQ . It seems that ScrollWindow method doesn't work. Does anybody have any idea or experience how to use it in PocketPC?
|
|
|
|
 |
|
 |
Child windows are not "scrolled" under WinCE. You need to move each of the child windows yourself by calling GetWindowRect, updating the top position, and then calling MoveWindow.
-Dave
|
|
|
|
 |
|
 |
I just can see the scrollbar, but it seems not to do work.
a code is just a code.
|
|
|
|
 |
|
 |
Hi,
I found the solution for this problem somewhere in www. Instead of ScrollWindow(...) funtion you should use wce_ScrollChildren(m_hWnd, 0, -iMove); method. It is an undocumented WinCE function. Now it works fine
Regards,
|
|
|
|
 |
|
 |
could you post the URL here?
Thank you!
a code is just a code.
|
|
|
|
 |
|
|
 |
|
 |
Hi, esmi:
At first, thank you very much for your help.
But I cannot open the link.
Could you post those codes here,
or post them in microsoft's usenet(news.microsoft.com), group microsoft.public.pocketpc.developer. If you post them to the usenet, please post the title here.
Thank you again!
|
|
|
|
 |
|
 |
Hi rockone,
I have to disappoint you, under the URL I gave you there is not any code, only information about replacing one function with other one. Only code I found is that above. Let's try to create i.e. a base class which will implement scrolling and use it to create your dialogs. Below you can find an example class which base on the code created by Jemin. Now you can create new dialog which will inherit from it. Only thing you need to remember is to handle OnInitDialog and OnVScroll events in dialog, i.e:
class CYourDialog : public CScrollDialog
{
//
//...
//
};
BOOL CYourDialog::OnInitDialog()
{
CScrollDialog::OnInitDialog();
//
// ...
//
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CYourDialog::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
CScrollDialog::OnVScroll(nSBCode, nPos, pScrollBar);
}
This is base dialog class bases on code created by Jemin:
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
/*
ScrollDialog.h
*/
#if !defined(AFX_SCROLLDIALOG_H__1CE3904E_8315_4479_A318_5C263F70BFED__INCLUDED_)
#define AFX_SCROLLDIALOG_H__1CE3904E_8315_4479_A318_5C263F70BFED__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
// ScrollDialog.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CScrollDialog dialog
class CScrollDialog : public CDialog
{
// Construction
public:
CScrollDialog(UINT nIDTemplate, CWnd* pParentWnd = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CScrollDialog)
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CScrollDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CScrollDialog)
virtual BOOL OnInitDialog();
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
private:
int m_nVertInc, m_nVscrollMax, m_nVscrollPos;
//Initialized the variable for Client Rectangle
CRect m_ClientRect;
void SetupScrollbars();
void ResetScrollbars();
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SCROLLDIALOG_H__1CE3904E_8315_4479_A318_5C263F70BFED__INCLUDED_)
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
// ScrollDialog.cpp : implementation file
//
#include "stdafx.h"
#include "resource.h"
#include "ScrollDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CScrollDialog dialog
#define VERT_PTS 5
CScrollDialog::CScrollDialog(UINT nIDTemplate, CWnd* pParentWnd)
: CDialog(nIDTemplate, pParentWnd)
{
//{{AFX_DATA_INIT(CScrollDialog)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CScrollDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CScrollDialog)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CScrollDialog, CDialog)
//{{AFX_MSG_MAP(CScrollDialog)
ON_WM_VSCROLL()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CScrollDialog message handlers
BOOL CScrollDialog::OnInitDialog()
{
CDialog::OnInitDialog();
m_nVscrollPos = 0;
GetClientRect(&m_ClientRect);
m_ClientRect.bottom *= 2;
ResetScrollbars();
SetupScrollbars();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CScrollDialog::ResetScrollbars()
{
ScrollWindow(0, m_nVscrollPos*VERT_PTS, NULL, NULL);
m_nVscrollPos = 0;
SetScrollPos(SB_VERT, m_nVscrollPos, TRUE);
}
void CScrollDialog::SetupScrollbars()
{
CRect tempRect;
GetClientRect(&tempRect);
m_nVertInc = (m_ClientRect.Height() - tempRect.Height())/VERT_PTS;
m_nVscrollMax = max(0, m_nVertInc);
m_nVscrollPos = min(m_nVscrollPos, m_nVscrollMax);
SetScrollRange(SB_VERT, 0, m_nVscrollMax, FALSE);
SetScrollPos(SB_VERT, m_nVscrollPos, TRUE);
}
void CScrollDialog::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
int nInc;
switch (nSBCode)
{
case SB_TOP: nInc = -m_nVscrollPos; break;
case SB_BOTTOM: nInc = m_nVscrollMax-m_nVscrollPos; break;
case SB_LINEUP: nInc = -1; break;
case SB_LINEDOWN: nInc = 1; break;
case SB_PAGEUP: nInc = min(-1, -m_nVertInc); break;
case SB_PAGEDOWN: nInc = max(1, m_nVertInc); break;
case SB_THUMBTRACK: nInc = nPos - m_nVscrollPos; break;
default: nInc = 0;
}
nInc = max(-m_nVscrollPos, min(nInc, m_nVscrollMax - m_nVscrollPos));
if (nInc)
{
m_nVscrollPos += nInc;
int iMove = -VERT_PTS * nInc;
// !!!! undocumented scrolling function !!!!
wce_ScrollChildren(m_hWnd, 0, -iMove);
// !!!!
SetScrollPos(SB_VERT, m_nVscrollPos, TRUE);
}
CDialog::OnVScroll(nSBCode, nPos, pScrollBar);
}
/////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////
Hope that will help you
Regards,
|
|
|
|
 |
|
 |
Thank you very much!
I have another method to implement my dialog.
But I will try your codes at another time.
Thank you again!
|
|
|
|
 |
|
 |
esmi wrote: Hope that will help you
Thanx Buddy It work for me.
Thank you very much.
regards,
Divyang Mithaiwala
System Engineer & Software Engineer
|
|
|
|
 |
|
 |
"Now open the resource file of the application into a text editor. Change the width and height of larger property page (IDD_PROPPAGE_LARGE) to same as that of small property page (IDD_PROPPAGE_SMALL)."
You said that....
But how can I open the rescource file of the application into a text editor?
How to do this... Can you explain more detials?
Thank you very much...
Jacky Chan
|
|
|
|
 |
|
 |
Hi Dear sir
please send me all your project files,
because I don't know VC++ well.
i did not understand what is :
1) GetClientRect(&m_ClientRect);
2) ResetScrollbars(); and SetupScrollbars();
3) m_nVscrollMax and m_nVscrollPos and m_nVertInc nInc
please send me the meaning of this functions and variables.
Thank you very much.
|
|
|
|
 |
|
 |
Hossein Mehry wrote:
1) GetClientRect(&m_ClientRect);
Well you can very well understand from function that he is getting the client rect.
ResetScrollbars(); and SetupScrollbars();
The source code is provided for getting more details.
m_nVscrollMax and m_nVscrollPos and m_nVertInc nInc
The names of variables themselves explain everything.
But I think the guy has a reason to put sourcecode with his article.
-----------------------------
In my dream, I was dorwning my §orrow§
But my §orrow§, they learned to §wim
|
|
|
|
 |