📄 queryresult.cpp
字号:
/************************************************************
//
// Copyright (C) 2002, Geo Soft
// All rights reserved
// mail: khuntipm@yahoo.com
// web: www.geosoftindia.com
// Khunti Popat
//
************************************************************/
// QueryResult.cpp : implementation file
//
#include "stdafx.h"
#include "resource.h"
#include "QueryResult.h"
#include "GeoPADDll.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern CGeoPADCtrl geoPAD;
int zid;
/////////////////////////////////////////////////////////////////////////////
// CQueryResult dialog
CQueryResult::CQueryResult(CWnd* pParent /*=NULL*/)
: CDialog(CQueryResult::IDD, pParent)
{
//{{AFX_DATA_INIT(CQueryResult)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CQueryResult::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CQueryResult)
DDX_Control(pDX, IDC_QRECT, m_QRect);
DDX_Control(pDX, IDC_LIST_QUERY_RESULT, m_listCtrl);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CQueryResult, CDialog)
//{{AFX_MSG_MAP(CQueryResult)
ON_WM_SIZE()
ON_NOTIFY(NM_CLICK, IDC_LIST_QUERY_RESULT, OnClickListQueryResult)
ON_BN_CLICKED(IDC_QRECT, OnQrect)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CQueryResult message handlers
BOOL CQueryResult::OnInitDialog()
{
CDialog::OnInitDialog();
// TODO: Add extra initialization here
int field = geoPAD.GeoPAD201();
int rec = geoPAD.GeoPAD211();
m_listCtrl.SetExtendedStyle(LVS_EX_FULLROWSELECT);
SetDlgItemInt(IDC_EDIT_QREC,rec);
CString fVal;
for(int f=0;f<field;f++)
{
fVal = geoPAD.GeoPAD203(f);
m_listCtrl.InsertColumn(f,fVal);
m_listCtrl.SetColumnWidth(f,50);
}
fVal.Empty();
geoPAD.GeoPAD212();
CString rVal;
for(int r = 0;r<rec;r++)
{
m_listCtrl.InsertItem(LVIF_TEXT|LVIF_STATE, r, _T(""),0, LVIS_SELECTED,0, 0);
for(f = 0;f<field;f++)
{
rVal = geoPAD.GeoPAD216(f);
m_listCtrl.SetItemText(r,f,rVal);
}
geoPAD.GeoPAD213();
}
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CQueryResult::OnSize(UINT nType, int cx, int cy)
{
CDialog::OnSize(nType, cx, cy);
// TODO: Add your message handler code here
// MoveWindow(0,0,200,200);
// CenterWindow();
}
void CQueryResult::OnClickListQueryResult(NMHDR* pNMHDR, LRESULT* pResult)
{
// TODO: Add your control notification handler code here
int n = m_listCtrl.GetSelectionMark();
*pResult = 0;
}
void CQueryResult::OnQrect()
{
// TODO: Add your control notification handler code here
/* zid = 117;
CMenu menu;
menu.LoadMenu(IDR_MAINFRAME);
CMenu* pPopup;
CRect rc;
pPopup = menu.GetSubMenu(6);
m_QRect.GetClientRect(&rc);
m_QRect.ClientToScreen(&rc);
pPopup->TrackPopupMenu(TPM_LEFTALIGN|TPM_VERTICAL,rc.left, rc.bottom,m_QRect.GetWindow(0));
*/
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -