Esempio n. 1
0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	if (!m_wndToolBar.Create(this) ||
		!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}

	if (!m_wndStatusBar.Create(this) ||
		!m_wndStatusBar.SetIndicators(indicators,sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}

/*	if (!m_wndProgressBar.Create(WS_CHILD,CRect(200,2,262,18),&m_wndStatusBar,ID_INDICATOR1))
	{
		TRACE0("Failed to create progress bar\n");
		return -1;      // fail to create
	}
	m_wndProgressBar.ShowWindow(SW_SHOW);
	m_wndProgressBar.SetRange(0,100);
*/
	// TODO: Remove this if you don't want tool tips or a resizeable toolbar
	m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

	// TODO: Delete these three lines if you don't want the toolbar to
	//  be dockable
	m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
	EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar(&m_wndToolBar);

	//histogram bar
	m_HistoBar.Create(this, IDD_HISTO, CBRS_TOP, ID_VIEW_HISTOGRAM);
	m_HistoBar.ShowWindow(0);
	m_HistoBar.EnableDocking(0);

	RECT r;
	GetWindowRect(&r);
	FloatControlBar(&m_HistoBar,CPoint(r.right-300,r.top+80),CBRS_ALIGN_TOP);
	
	// <<<TWAIN>>>
	InitTwain(m_hWnd);
//	if(!IsValidDriver()) AfxMessageBox("Unable to load Twain Driver.");
	m_fullscreen=false;

	return 0;
}
Esempio n. 2
0
/*
Constructor:
	Parameters : HWND 
				Window to subclass
				 
*/
CTwain::CTwain(HWND hWnd)
{
	m_hTwainDLL = NULL;
	m_pDSMProc = NULL;
	m_bSourceSelected = FALSE;
	m_bDSOpen = m_bDSMOpen = FALSE;
	m_bSourceEnabled = FALSE;
	m_bModalUI = TRUE;
	m_nImageCount = TWCPP_ANYCOUNT;
	if(hWnd)
	{
		InitTwain(hWnd);
	}
}
Esempio n. 3
0
/** Constructor parameters : HWND: Window to subclass
 */
TwainIface::TwainIface(HWND hWnd)
{
    m_hMessageWnd     = 0;
    m_hTwainDLL       = NULL;
    m_pDSMProc        = NULL;
    m_bSourceSelected = false;
    m_bDSOpen         = false;
    m_bDSMOpen        = false;
    m_bSourceEnabled  = false;
    m_bModalUI        = true;
    m_nImageCount     = TWCPP_ANYCOUNT;
    if(hWnd)
    {
        InitTwain(hWnd);
    }
}
Esempio n. 4
0
KSaneWidgetPrivate::KSaneWidgetPrivate(): QWidget(0)
{
    // This is a dumy widget not visible. We use Qwidget to dispatch Windows event to 
    // Twain interface. This is not possible to do it using QObject as well.

    m_hMessageWnd     = 0;
    m_hTwainDLL       = NULL;
    m_pDSMProc        = NULL;
    m_bDSOpen         = false;
    m_bDSMOpen        = false;
    m_bSourceEnabled  = false;
    m_bModalUI        = true;
    m_nImageCount     = TWCPP_ANYCOUNT;

    InitTwain();
}
Esempio n. 5
0
int EVOpenDlg::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CDialog::OnCreate(lpCreateStruct) == -1)
		return -1;

	// TODO:  在此添加您专用的创建代码
	InitTwain(m_hWnd);
	if(!IsValidDriver())
	{
		AfxMessageBox("Unable to load Twain Driver.");
	}

	SetTimer(1,1000,NULL);
	dlgArea = new EVAreaDlg;
	dlgArea->Create(IDD_AREA,this);
	dlgArea->pDlg = this;
	dlgArea->uEditID = IDC_NEWEDIT4;
	dlgArea->ShowWindow(SW_HIDE);
	dlgArea->m_szArea=&m_szArea;

	return 0;
}
Esempio n. 6
0
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
	if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
		return -1;
	
	//if (!m_wndToolBar.Create(this) ||
	if (!m_wndToolBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
		| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
		!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}

	if (!m_wndStatusBar.Create(this) ||
		!m_wndStatusBar.SetIndicators(indicators,sizeof(indicators)/sizeof(UINT)))
	{
		TRACE0("Failed to create status bar\n");
		return -1;      // fail to create
	}

	if (!m_wndCmdBar.CreateEx(this, TBSTYLE_FLAT, WS_CHILD | WS_VISIBLE | CBRS_TOP
		| CBRS_GRIPPER | CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC) ||
		!m_wndCmdBar.LoadToolBar(IDR_TOOLBAR2))
	{
		TRACE0("Failed to create toolbar\n");
		return -1;      // fail to create
	}

/*	if (!m_wndProgressBar.Create(WS_CHILD,CRect(200,2,262,18),&m_wndStatusBar,ID_INDICATOR1))
	{
		TRACE0("Failed to create progress bar\n");
		return -1;      // fail to create
	}
	m_wndProgressBar.ShowWindow(SW_SHOW);
	m_wndProgressBar.SetRange(0,100);
*/
	// TODO: Remove this if you don't want tool tips or a resizeable toolbar
	m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);
	m_wndCmdBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
		CBRS_TOOLTIPS | CBRS_FLYBY | CBRS_SIZE_DYNAMIC);

	// TODO: Delete these three lines if you don't want the toolbar to
	//  be dockable
	m_wndToolBar.EnableDocking(CBRS_ALIGN_ANY);
	EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar(&m_wndToolBar);

	m_wndCmdBar.EnableDocking(CBRS_ALIGN_ANY);
	DockControlBar(&m_wndCmdBar);

	//histogram bar
	m_HistoBar.Create(this, IDD_HISTO, CBRS_TOP, ID_VIEW_HISTOGRAM);
	m_HistoBar.ShowWindow(0);
	m_HistoBar.EnableDocking(0);

	RECT r;
	GetWindowRect(&r);
	FloatControlBar(&m_HistoBar,CPoint(r.right-300,r.top+80),CBRS_ALIGN_TOP);

	m_pDlgFlood = new DlgFloodFill(this);

	// <<<TWAIN>>>
	InitTwain(m_hWnd);
//	if(!IsValidDriver()) AfxMessageBox("Unable to load Twain Driver.");

	m_fullscreen=false;

#ifdef VATI_EXTENSIONS
    // load the window size and positions
	CRect rect;
	rect.left   = AfxGetApp()->GetProfileInt ( _T("Screen"), _T("left"),      0 ) ;
	rect.top    = AfxGetApp()->GetProfileInt ( _T("Screen"), _T("top"),       0 ) ;
	rect.right  = AfxGetApp()->GetProfileInt ( _T("Screen"), _T("right"),   850 ) ;
	rect.bottom = AfxGetApp()->GetProfileInt ( _T("Screen"), _T("bottom"),  650 ) ;

	// resize
	if (rect.left && rect.top && rect.right && rect.bottom )
		MoveWindow( & rect,0 );
#endif

	return 0;
}