Save Format v2.0(2)
@begin Form "Form1"
 Exported 0;

 @begin Object "WModelessDialog"
  WSCaption 1;
  WSDlgBorder 1;
  WSSysMenu 1;
  WSSystemMenu 1;
  WSMinimizeBox 1;
  WSMaximizeBox 1;
  WSGroup 1;
  WSTabStop 1;
  WSVisible 1;
  Font "8.MS Sans Serif";
  Icon "WIcon( WResourceID( ICON_02 ) )";
  FormPositionType "Centered";
  FormAbsTop "93";
  FormAbsLeft "77";
  Text "Max Equation";
  @begin UserFunction "Form1()"
   Compiler 1;
   GencodeSrcLine 255;
   FunctionName "Form1::Form1()";
  @end;
  @begin UserFunction "~Form1()"
   Compiler 1;
   GencodeSrcLine 259;
   FunctionName "Form1::~Form1()";
  @end;
  ResID 101;
  DesignName Form1;
  TabIndex 0;
  DesignRect 79,95,194,175;
 @end;

 @begin Object "WLabel"
  WSSLeftNoWordWrap 1;
  WSSNotify 1;
  WCCSNoResize 1;
  WCCSNoParentAlign 1;
  WSChild 1;
  WSVisible 1;
  Font "10.MS Sans Serif.CharSet=204";
  Text "Enter A  here:";
  ResID 101;
  DesignName label_2;
  TabIndex 0;
  DesignRect 20,30,60,14;
 @end;

 @begin Object "WLabel"
  WSSLeftNoWordWrap 1;
  WSSNotify 1;
  WCCSNoResize 1;
  WCCSNoParentAlign 1;
  WSChild 1;
  WSVisible 1;
  Font "10.MS Sans Serif.CharSet=204";
  Text "Enter  B  here:";
  ResID 102;
  DesignName label_3;
  TabIndex 1;
  DesignRect 20,55,60,14;
 @end;

 @begin Object "WLabel"
  WSSLeftNoWordWrap 1;
  WSSNotify 1;
  WCCSNoResize 1;
  WCCSNoParentAlign 1;
  WSChild 1;
  WSVisible 1;
  Font "10.MS Sans Serif.CharSet=204";
  Text "Enter  C  here:";
  ResID 103;
  DesignName label_4;
  TabIndex 2;
  DesignRect 20,80,60,14;
 @end;

 @begin Object "WCommandButton"
  WSChild 1;
  WSMaximizeBox 1;
  WSTabStop 1;
  WSVisible 1;
  Pressed "0";
  Text "Count";
  ToolTipText "Use dot (.)  as a decimal point";
  @begin Event "Click"
   GencodeSrcLine 263;
   FunctionName "Form1::cb_1_Click";
  @end;
  ResID 104;
  DesignName cb_1;
  TabIndex 3;
  DesignRect 140,25,45,20;
 @end;

 @begin Object "WCommandButton"
  WSChild 1;
  WSMaximizeBox 1;
  WSTabStop 1;
  WSVisible 1;
  Pressed "0";
  Text "Exit";
  Cancel "1";
  @begin Event "Click"
   GencodeSrcLine 317;
   FunctionName "Form1::cb_2_Click";
  @end;
  ResID 105;
  DesignName cb_2;
  TabIndex 4;
  DesignRect 140,55,45,20;
 @end;

 @begin Object "WLabel"
  WSSLeftNoWordWrap 1;
  WSSNotify 1;
  WCCSNoResize 1;
  WCCSNoParentAlign 1;
  WSChild 1;
  WSVisible 1;
  Font "10.MS Sans Serif.CharSet=204";
  Text "  Roots are:";
  ResID 106;
  DesignName label_5;
  TabIndex 5;
  DesignRect 20,115,50,15;
 @end;

 @begin Object "WLabel"
  WSSLeftNoWordWrap 1;
  WSSNotify 1;
  WCCSNoResize 1;
  WCCSNoParentAlign 1;
  WSChild 1;
  WSVisible 1;
  Font "10.MS Sans Serif.CharSet=204";
  Text " and";
  ResID 107;
  DesignName label_6;
  TabIndex 6;
  DesignRect 120,115,25,15;
 @end;

 @begin Object "WLabel"
  WSSLeftNoWordWrap 1;
  WSSNotify 1;
  WCCSNoResize 1;
  WCCSNoParentAlign 1;
  WSChild 1;
  WSVisible 1;
  Font "10.MS Sans Serif.CharSet=204";
  Text " Discriminant  is:";
  ResID 108;
  DesignName label_7;
  TabIndex 7;
  DesignRect 25,140,70,15;
 @end;

 @begin Object "WTextBox"
  WTextBoxAutoHScroll 1;
  WSBorder 1;
  WSChild 1;
  WSExClientEdge 1;
  WSVisible 1;
  TextLimit "9";
  @begin Event "Change"
   GencodeSrcLine 324;
   FunctionName "Form1::textb_1_Change";
  @end;
  ResID 109;
  DesignName textb_1;
  TabIndex 8;
  DesignRect 80,30,45,15;
 @end;

 @begin Object "WTextBox"
  WTextBoxAutoHScroll 1;
  WSBorder 1;
  WSChild 1;
  WSExClientEdge 1;
  WSVisible 1;
  TextLimit "9";
  ResID 110;
  DesignName textb_2;
  TabIndex 9;
  DesignRect 80,55,45,15;
 @end;

 @begin Object "WTextBox"
  WTextBoxAutoHScroll 1;
  WSBorder 1;
  WSChild 1;
  WSExClientEdge 1;
  WSVisible 1;
  TextLimit "9";
  ResID 111;
  DesignName textb_3;
  TabIndex 10;
  DesignRect 80,80,45,15;
 @end;

 @begin Object "WTextBox"
  WTextBoxAutoHScroll 1;
  WTextBoxReadOnly 1;
  WSBorder 1;
  WSChild 1;
  WSExClientEdge 1;
  WSVisible 1;
  TextLimit "12";
  ResID 112;
  DesignName textb_4;
  TabIndex 11;
  DesignRect 70,115,50,15;
 @end;

 @begin Object "WTextBox"
  WTextBoxAutoHScroll 1;
  WTextBoxReadOnly 1;
  WSBorder 1;
  WSChild 1;
  WSExClientEdge 1;
  WSVisible 1;
  TextLimit "12";
  ResID 113;
  DesignName textb_5;
  TabIndex 12;
  DesignRect 140,115,45,15;
 @end;

 @begin Object "WTextBox"
  WTextBoxAutoHScroll 1;
  WTextBoxReadOnly 1;
  WSBorder 1;
  WSChild 1;
  WSExClientEdge 1;
  WSVisible 1;
  TextLimit "12";
  ResID 114;
  DesignName textb_6;
  TabIndex 13;
  DesignRect 95,140,75,15;
 @end;

 @begin Object "WLabel"
  WSSLeftNoWordWrap 1;
  WSSNotify 1;
  WCCSNoResize 1;
  WCCSNoParentAlign 1;
  WSChild 1;
  WSVisible 1;
  Font "13.Impact.CharSet=161";
  ForeColor "[ 255 0 0 ]";
  Text "   SQUARE EQUATION aX\262+bX+c=0";
  ToolTipText "Square Equation aX*X+bX+c=0";
  ResID 115;
  DesignName label_1;
  TabIndex 14;
  DesignRect 20,5,150,18;
 @end;

 @begin HPPPrefixBlock
@begin-code HPPPrefix

// Declarations added here will be included at the top of the .HPP file

@end-code;
  GencodeSrcLine 10;
 @end;

 @begin CPPPrefixBlock
@begin-code CPPPrefix

// Code added here will be included at the top of the .CPP file

//  Include definitions for resources.
#include "WRes.h"
#include <math.h>

@end-code;
  GencodeSrcLine 10;
 @end;

 @begin ClassContentsBlock
@begin-code ClassContents

    public:
        // add your public instance data here
    private:
        // add your private instance data here
    protected:
        // add your protected instance data here

@end-code;
  GencodeSrcLine 71;
 @end;

@begin-code GeneratedClassContents

        Form1();
        ~Form1();

@end-code;

@begin-code Code "Form1::Form1()"

@@CLASSNAME@::@CLASSNAME@()
{

}

@end-code;

@begin-code Code "Form1::~Form1()"

@@CLASSNAME@::~@CLASSNAME@()
{

}

@end-code;

@begin-code Code "Form1::cb_1_Click"

WBool @CLASSNAME@::cb_1_Click(
    WObject *           source,
    WEventData *        event )
{  textb_4->SetText( "" );
   textb_5->SetText( "" );  //clean Text boxes
   textb_6->SetText( "" );

   double A,B,C,disk,x1,x2;
   WString a,b,c;
   char x1s[10];       //define 
   char x2s[10];
   char disks[10] ;

  a = textb_1->GetText();
  b = textb_2->GetText();
  c = textb_3->GetText();     //get and convert TextBox contents
  A=atof(a);
  B=atof(b);
  C=atof(c);

  disk=B*B-(4*A*C);               //count diskriminant

   if (disk<0)
  {
    WString neg="negative";
    WString x="none";
    textb_6->InsertText(neg);    //if diskriminant is negative
    textb_4->InsertText(x);
    textb_5->InsertText(x);
    return FALSE;
  }

  x1=(-B+pow(disk,0.5))/(2.*A);   //count roots
  x2=(-B-pow(disk,0.5))/(2.*A);

  gcvt(x1,10, x1s);
  gcvt(x2,10, x2s);               //convert results
  gcvt(disk,10,disks);

    if (disk==0)
  {
    WString root2="same";
    WString zero="equal zero";
    textb_6->InsertText(zero);  //if diskriminant is equal zero
    textb_5->InsertText(root2);
    textb_4->InsertText(x1s);
    return FALSE;
  }

  textb_4->InsertText(x1s);
  textb_5->InsertText(x2s);     //insert answers
  textb_6->InsertText(disks);
  return FALSE;
}

@end-code;

@begin-code Code "Form1::cb_2_Click"

WBool @CLASSNAME@::cb_2_Click(
	WObject *   		source,
	WEventData *		event )
{
    Close();
    return FALSE;
    }

@end-code;

@begin-code Code "Form1::textb_1_Change"

WBool @CLASSNAME@::textb_1_Change(
	WObject *   		source,
	WEventData *		event )
{


    return FALSE;
}

@end-code;
@end;
