Академический Документы
Профессиональный Документы
Культура Документы
1(A)
Introduction
Here you can find the list with the standard set of fonts common to all
versions of Windows and their Mac substitutes, referred sometimes as
"browser safe fonts". This is the reference I use when making web pages
and I expect you will find it useful too.
If you are new to web design, maybe you are thinking: "Why I have to limit
to that small set of fonts? I have a large collection of nice fonts in my
computer". Well, as seasoned web designers already know, browsers can
use only the fonts installed in each computer, so it means that every
visitor of your web page needs to have all the fonts you want to use
installed in his/her computer. Of course, different people will have different
fonts installed, and thus come the need of a standard set of fonts.
Fortunately, CSS allows set several values for the font-family property,
which eases the task a bit.
If you want to know how the fonts are displayed in other OS's or browsers
than yours, after the table you can find several screen shots of this page in
different systems and browsers. Also, you can take a look to the list of the
default fonts included with each version of Windows.
The list
First, a few introductory notes:
In some cases the Mac equivalent is the same font, since Mac OS X
also includes some of the fonts shipped with Windows.
Bold style
New, monospace
New, monospace
Impact, Impact5,
Charcoal6, sans-serif
Impact, Impact5,
Charcoal6, sans-serif
Lucida
Console, Monaco5, monospace
Lucida
Console, Monaco5, monospac
e
Verdana, Verdana,
Geneva, sans-serif
Verdana, Verdana,
Geneva, sans-serif
Q.2(a)
Modal and Modeless Dialog Boxes
Dialog boxes are either modal or modeless. A modal dialog box must be
closed (hidden or unloaded) before you can continue working with the rest
of the application. For example, a dialog box is modal if it requires you to
click OK or Cancel before you can switch to another form or dialog box.
The About dialog box in Visual Basic is modal. Dialog boxes that display
important messages should always be modal that is, the user should
always be required to close the dialog box or respond to its message before
proceeding.
Modeless dialog boxes let you shift the focus between the dialog box and
another form without having to close the dialog box. You can continue to
work elsewhere in the current application while the dialog box is displayed.
Modeless dialog boxes are rare. From the Edit menu, the Find dialog box in
Visual Basic is an example of a modeless dialog box. Use modeless dialog
boxes to display frequently used commands or information.
To display a form as a modal dialog box
Use the Show method with a style argument of vbModal (a constant for
the value 1).
For example:
' Display frmAbout as a modal dialog.
frmAbout.Show vbModal
To display a form as a modeless dialog box
Use the Show method without a style argument.
For example:
' Display frmAbout as a modeless dialog.
frmAbout.Show
Note If a form is displayed as modal, the code following the Show method
is not executed until the dialog box is closed. However, when a form is
shown as modeless, the code following the Show method is executed
immediately after the form is displayed.
The Show method has another optional argument, owner, that can be used
to specify a parent-child relationship for a form. You can pass the name of a
form to this argument to make that form the owner of the new form.
To display a form as a child of another form
Use the Show method with both style and owner arguments.
For example:
Q.3 (a)
File and Database Classes
These classes allow you to store information to a database or a disk file.
There are three sets of database classes OLE DB, ODBC, and DAO that
provide similar functionality. The OLE DB group is implemented using OLE
DB and works with the OLE DB consumer templates, the DAO group is
implemented using the Data Access Object, and the ODBC group is
implemented using Open Database Connectivity. There are also a set of
classes for manipulating standard files, Active streams, and HTML streams.
The following categories of classes support data persistence.
File I/O Classes
OLE DB Classes
DAO Classes
ODBC Classes
serializes its contents. For more information about the file classes and
serialization, see the article Files in MFC and the articleSerialization.
OLE DB Classes
The OLE DB support in MFC currently consists of the
class COLEDBRecordView. COleDBRecordView displays database
records in controls, through a form view directly connected to
a CRowset object. For more information about the OLE DB consumer
templates, see List of OLE DB Consumer Templates.
DAO Classes
These classes work with the other application framework classes to give
easy access to Data Access Object (DAO) databases, which use the same
database engine as Microsoft Visual Basic and Microsoft Access. The DAO
classes can also access a wide variety of databases for which Open
Database Connectivity (ODBC) drivers are available.
Programs that use DAO databases will have at least
a CDaoDatabase object and a CDaoRecordset object.
ODBC Classes
These classes work with the other application framework classes to give
easy access to a wide variety of databases for which Open Database
Connectivity (ODBC) drivers are available.
Programs that use ODBC databases will have at least a CDatabase object
and a CRecordset object.
Q.4(a)
visual c++ Status bar example
1- Make single document MFC application and deselect printing and
printview options
2- In the view menu chose resource and then add New resource and then
add ID_TIME_STATUSBAR and accept the defaul value (101) .
3- Add message handler and update message handler in the CMainFrame
class for both ID_VIEW_STATUS_BAR .
pParentWnd
Points to the parent window object (of type CWnd) to which the dialog
object belongs. If it is NULL, the dialog object's parent window is set to
the main application window.
nIDTemplate
Contains the ID number of a dialog-box template resource.
Return Value
Both forms return nonzero if dialog-box creation and initialization were
successful; otherwise 0.
Remarks
You can put the call to Create inside the constructor or call it after the
constructor is invoked.
Two forms of the Create member function are provided for access to the
dialog-box template resource by either template name or template ID
number (for example, IDD_DIALOG1).
For either form, pass a pointer to the parent window object.
If pParentWnd is NULL, the dialog box will be created with its parent or
owner window set to the main application window.
The Create member function returns immediately after it creates the dialog
box.
Use the WS_VISIBLE style in the dialog-box template if the dialog box
should appear when the parent window is created. Otherwise, you must
call ShowWindow. For further dialog-box styles and their application, see
the DLGTEMPLATE structure in the Windows SDK and Window Styles in
the MFC Reference.
Use the CWnd::DestroyWindow function to destroy a dialog box created
by the Create function.
Example
C++
void CMyDialog::OnMenuShowSimpleDialog()
{
2. Once you are in the Visual Studio, press the following combination:
Alt -> b -> o to access the Set Active Configuration... dialog box.
Click ExoSpin - Win32 Release and press Enter
3. Pick up an Edit box from the Control toolbox and drop it in your dialog
4. Change the identifier of that Edit to IDC_EDITSPIN.
5.Get a Spin control from the Controls toolbox, drop that Spin control on
your dialog, preferably next on the right of the Edit box.
Press Alt+Enter to access the Spin Properties dialog.
from the General tab, change the Spin's ID to IDC_SPIN. From
theStyles
tab, specify the Alignment as Right, check the Set buddy integer.
c) To build and execute your app now, press Ctrl+F5.
3.
its
The Spin control works fine but like most users, you might not like
orientation.
Launch your Visual C++, click the File menu and click the New sub menu. Click the Projects tab
for the AppWizard as shown below. Select the MFC AppWizard (exe), type your project name and
set the project location as needed. Leave other setting as default and click the OK button.
Q.8 (b)
Structured Programming can save time and energy when writing simple programs that
implement classes or complex functions as would be the case in object-oriented programming.
In most cases straightforward pieces of code would get the job done. Structured programming is
ideal for development of small programs as it would beat the purpose spending a lot of time and
energy designing classes when an entire working program could be developed within the same
time period.
This will also hold true in that small programs are easy to maintain and most fit within a single
page or so, making more sense for the Web developer to visualize the program code. It therefore
make structured programming well suited for small to medium website which would probably
not require much maintenance.
Structured programs are easy to read and understand as you would simply need to follow the
source code as it is written on the file as you would be guaranteed that there are no jumps or
deviations to other pieces of code in other files. This however does not mean such a program
would necessarily be easier to maintain; that brings me to the reason why object-oriented
programming would be suited in other situations.
needed. So having an application with several hundred buttons implemented as objects would
be pretty easy to maintain, for example, if the developer wanted to change the style or behavior
of all the buttons, it would simply entail changing a single object which defines everything
about the button and this would change every instance of the button object.
Even though object-oriented programming is suitable for large project and
long term maintenance of software of web projects, this method of
programming poses its own disadvantages as object-oriented programming
tends to be more complex than structured programming as there is a lot as
far as design the decisions that need to be made and consequently the
entire task of managing the project may be a bit difficult to the
inexperienced web developer.
Q.9 (a)
STUDENT MARKSHEET
#include
#include
#include
class stud
{
int rno,m1,m2,m3,tot;
char name[20];
float avg;
public:
void getdata()
{
cout<<"\n\nEnter the rno:";
cin>>rno;
cout<<"Enter the name:";
cin>>name;
cout<<"Enter the first marks:";
cin>>m1;
cout<<"Enter the second mark:";
cin>>m2;
cout<<"Enter the third mark:";
cin>>m3;
}
void caldata()
{
tot=m1+m2+m3;
avg=tot/3;
}
void putdata()
{
cout<<"\n"<<rno<< "\t="" ";=""
cout<<name<<"\t\t";
cout<<m1<<"\t";
cout<<m2<<"\t";
cout<<m3<<"\t";
cout<<tot<<"\t";
cout<
if(avg>=80)
cout<<"\t A";
else if(avg>=60&&avg<=79)
cout<<"\t B";
else if(avg>=40&&avg<=59)
cout<<"\t C";
else
cout<<"\t FAIL";
}
};
void main()
{
int i,n;
stud s[20];
clrscr();
cout<<"\n\t\t\t STUDENT MARKSHEET";
cout<<"\n\t\t\t ~~~~~~~~~~~~~~~~~~";
cout<<"\n ENTER THE NUMBER OF STUDENTS:";
cin>>n;
for(i=0;i
{
s[i].getdata();
s[i].caldata();
}
cout<<"\n\nRNO"<<"\t"<<"NAME"<<"\t\t"<<"M1"<<"\t"<<"M2"<<"\t"<<"M3"<<"\t"<<"TOT"<<"\t"<<"AVG"<<"\t"<<"GRADE"<<"\n";
cout<<"_______________________________________________________________";
for(i=0;i
{
s[i].putdata();
}
getch();
}
OUTPUT:
STUDENT MARKSHEET
~~~~~~~~~~~~~~~~~~
Q.10 (a)
MFC Application Architecture Classes
Classes in this category contribute to the architecture of a framework
application. They supply functionality common to most applications. You fill
in the framework to add application-specific functionality. Typically, you do
so by deriving new classes from the architecture classes, and then adding
new members or overriding existing member functions.
Application wizards generate several types of applications, all of which use
the application framework in differing ways. SDI (single document interface)
and MDI (multiple document interface) applications make full use of a part
solving this problem. This topic explains the classes available and how to
use them to create thread-safe classes in a typical multithreaded
application.
A typical multithreaded application has a class that represents a resource to
be shared among threads. A properly designed, fully thread-safe class does
not require you to call any synchronization functions. Everything is handled
internally to the class, allowing you to concentrate on how to best use the
class, not about how it might get corrupted. An effective technique for
creating a fully thread-safe class is to merge the synchronization class into
the resource class. Merging the synchronization classes into the shared
class is a straightforward process.
As an example, take an application that maintains a linked list of accounts.
This application allows up to three accounts to be examined in separate
windows, but only one can be updated at any particular time. When an
account is updated, the updated data is sent over the network to a data
archive.
This example application uses all three types of synchronization classes.
Because it allows up to three accounts to be examined at one time, it
uses CSemaphore to limit access to three view objects. When an attempt to
view a fourth account occurs, the application either waits until one of the
first three windows closes or it fails. When an account is updated, the
application uses CCriticalSection to ensure that only one account is updated
at a time. After the update succeeds, it signals CEvent, which releases a
thread waiting for the event to be signaled. This thread sends the new data
to the data archive.
Q.11 (a)
StaticText control
StaticText is display text that the user can select but cannot modify with the keyboard.
You can explicitly modify the StaticText in a script.
Properties
StaticText
property
Datatype
AccessibleDescrip String
tion
Description
StaticText
property
Datatype
Description
AccessibleName
String
AccessibleRole
Alignment
Alignment
(enumerated)
Left!
Center!
Right!
BackColor
Long
Border
Boolean
BorderColor
Long
BorderStyle
BorderStyle
(enumerated)
StaticText
property
BringToTop
Datatype
Description
StyleBox!
StyleLowered!
StyleRaised!
StyleShadowBox!
Boolean
ClassDefinition
PowerObject
DisabledLook
Boolean
DragAuto
Boolean
StaticText
property
Datatype
Description
DragIcon
String
Enabled
Boolean
FaceName
String
FillPattern
FillPattern
(enumerated)
BDiagonal!
Diamond!
FDiagonal!
Horizontal!
Solid!
Square!
StaticText
property
Datatype
Description
Vertical!
FDiagonal! is lines going from the lower-left to the
upper-right. BDiagonal! is lines going from the
upper-left to the lower right.
FocusRectangle
Boolean
FontCharSet
FontCharSet
(enumerated)
FontFamily
FontFamily
(enumerated)
AnyFont!
Decorative!
Modern!
Roman!
Script!
Swiss!
StaticText
property
FontPitch
Datatype
Description
FontPitch
(enumerated)
Default!
Fixed!
Variable!
Height
Integer
Italic
Boolean
Pointer
String
RightToLeft
Boolean
TabOrder
Integer
StaticText
property
Datatype
Description
Tag
String
Text
String
TextColor
Long
TextSize
Integer
Underline
Boolean
Visible
Weight
Boolean
Integer
StaticText
property
Datatype
Description
Width
Integer
Integer
Integer