25 Years of Programming
An open source source for C, C++, OWL, BASIC, MDB, XLS, DOT, and more...
Home   Projects   Up   Sitemap   Search   Blog   Forum+Chat   About Us   Privacy   Terms of Use   Feedback   FAQ   Images   Services   Ads   Donate   Humor

Library.cpp

A project node that pulls into the WTalk.cpp natural language processing chatbot project the various library cpp files that it needs.

library.h

/*	library.h			7-23-01
	This is part of the WTalk project.
	Copyright (C)2000-2001 Steven Whitney.
	Published under GNU GPL (General Public License) Version 2, with ABSOLUTELY NO WARRANTY.
	Initially published by http://25yearsofprogramming.com.

declarations for global #defines, functions, externs, etc. that are
peculiar to this program, and thus aren't declared in my.h,
and are needed by multiple source files in this project.

*/
#ifndef __LIBRARY_H
#define __LIBRARY_H

#include <owl\control.h>
#include "c:\bcs\my.h"

//////////////////////////////////////////////////////////////////////////////
// global #defines
//----------------------------------------------------------------------------

//////////////////////////////////////////////////////////////////////////////
// prototypes of global functions that may be used by multiple source files
//----------------------------------------------------------------------------
void DialogUnitsToScreenUnits(TControl* c);

//////////////////////////////////////////////////////////////////////////////
#endif			// __LIBRARY_H

library.cpp

/*	library.cpp		3/13/03
	This is part of the WTalk project.
	Copyright (C)2000, 2003 Steven Whitney.
	Published under GNU GPL (General Public License) Version 2, with ABSOLUTELY NO WARRANTY.
	Initially published by http://25yearsofprogramming.com.

library file for wtalk.ide.

This is a separate project node that pulls into the project various library cpp files that it needs.

The header list here must include ALL headers used anywhere in project, so the conditional
includes in mylib.cpp (it must be the last include here) know what is needed.

*/
#include <owl\owlpch.h>
#include <owl\opensave.h>
#include <owl\radiobut.h>
#include <owl\buttonga.h>
#include <owl\editsear.h>
// #include <owl\statusba.h>
// #include <owl\controlb.h>
#include <owl\inputdia.h>
#include <bwcc.h>					// IDHELP
#include <math.h>
#include <classlib\time.h>
#include <classlib\arrays.h>
#include <dir.h>                    // MAXPATH
#pragma hdrstop

#include "c:\bcs\my.h"

#include "dic.h"
#include "fact.h"
#include "clasfier.h"

#include "library.h"
#include "c:\bcs\library\filearay.cpp"
#include "c:\bcs\library\textsub.cpp"
#include "c:\bcs\library\wordlist.cpp"
// #include "c:\bcs\library\wserial.cpp"
#include "c:\bcs\mylib.cpp"

#include "wtalk.rh"

//////////////////////////////////////////////////////////////////////////////
// global functions peculiar to this program
//----------------------------------------------------------------------------
// helps with laying out controls: the control screen locations in
// the .RC file are in Dialog Units, not the same as pixels, so you can't
// just transfer those numbers to the constructors when you're using the
// .RC as a guide in setting up the controls in a TWindow.
// scales the Attr X,Y,W,H members by given amounts (modifies them in-place).
void DialogUnitsToScreenUnits(TControl* c)
{
double xfactor = 1.9;
double yfactor = 1.7;

c->Attr.X = (int)min(c->Attr.X * xfactor, (double)MAXINT);
c->Attr.Y = (int)min(c->Attr.Y * yfactor, (double)MAXINT);
c->Attr.W = (int)min(c->Attr.W * xfactor, (double)MAXINT);
c->Attr.H = (int)min(c->Attr.H * yfactor, (double)MAXINT);
}                     	//DialogUnitsToScreenUnits
//----------------------------------------------------------------------------

 

 

Valid HTML 4.01 Transitional Valid CSS
View content labeling at ICRA.
Copyright ©2007 Steven Whitney. Last modified 09/25/2007.