terça-feira, 24 de setembro de 2019

C++ Builder - desenhando partes de uma imagem

Quando clicamos no botão Draw, uma variável
global inteira inicializada em -1 é incrementada
e estes valores serão utilizados para a chamada
de cada parte recortada de nosso bitmap,
e estas chamadas só ocorrem clicando neste mesmo botão,
onde preferimos usar um nome em inglês para encurtar
o seu tamanho.
O botão imagem, chama o bitmap principal,
mas o programa funciona muito bem sem ele,
na verdade está servindo como personalização,
e para que o usuário saiba de onde está sendo
desenhado o bitmap em tempo de execução.
Então sem entrar em detalhes da parte gráfica de bitmaps,
o que estamos fazendo aqui é recortando partes
do bitmap, estrategicamente e desenhando num destino
escolhido preferivelmente por nós mesmos.



//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include <memory>
#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
int a = -1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1 ( TComponent* Owner )
: TForm ( Owner )
{
}
Graphics::TBitmap* bitimap;
//---------------------------------------------------------------------------
void __fastcall TForm1::Informe ( TObject *Sender ) {
    Canvas -> Font -> Name = "Garamond";
    Canvas -> Font -> Size = 14;
    Canvas -> Font -> Color = clBlack;
    Canvas -> TextOut ( 200, 240, "Por: " );
    Canvas -> Font -> Color = clRed;
    Canvas -> TextOut ( 240, 240, "Samuel Lima" );
    Canvas -> Font -> Color = clBlue;
    Canvas -> TextOut ( 196, 260, "sa_sp10@hotmail.com" );
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click ( TObject *Sender )
{
    //Coordenadas do primeiro bitmap
    Canvas -> Draw ( 30, 40, bitimap );
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click ( TObject *Sender )
{
    String str;
    int x;
    int y;
    int largura;
    int altura;
    int x_1;
    int y_1;
    int largura_1;
    int altura_1;
    a++;
    if ( a < 10 ) {
      str = "0";
    }
    str += a;
    Label1 -> Caption = str;
    /*====================================================================*/
    if ( a == 0 ) {
        //Posição do recorte a ser capturado
        x = 68;
        y = 134;
        //Tamanho do recorte a ser capturado
        largura = 60;
        altura = 60;
        // imprimindo a região cortada
        //Posicionamento do recorte capturado da imagem
        x_1 = 403;
        y_1 = 50;
        //Tamanho do recorte destino
        largura_1 = 60;
        altura_1 = 60;
    }
    /*====================================================================*/
    if ( a == 1 ) {
        //Posição do recorte a ser capturado
        x = 0;
        y = 0;
        //Tamanho do recorte a ser capturado
        largura = 60;
        altura = 60;
        // imprimindo a região cortada
        //Posicionamento do recorte capturado da imagem
        x_1 = 403;
        y_1 = 50;
        //Tamanho do recorte destino
        largura_1 = 60;
        altura_1 = 60;
    }
    /*====================================================================*/
    if ( a == 2 ) {
        //Posição do recorte a ser capturado
        x = 68;
        y = 0;
        //Tamanho do recorte a ser capturado
        largura = 60;
        altura = 60;
        // imprimindo a região cortada
        //Posicionamento do recorte capturado da imagem
        x_1 = 403;
        y_1 = 50;
        //Tamanho do recorte destino
        largura_1 = 60;
        altura_1 = 60;
    }
    /*====================================================================*/
    if ( a == 3 ) {
        //Posição do recorte a ser capturado
        x = 133;
        y = 0;
        //Tamanho do recorte a ser capturado
        largura = 60;
        altura = 60;
        // imprimindo a região cortada
        //Posicionamento do recorte capturado da imagem
        x_1 = 403;
        y_1 = 50;
        //Tamanho do recorte destino
        largura_1 = 60;
        altura_1 = 60;
        }
        /*====================================================================*/
        if ( a == 4 ) {
        //Posição do recorte a ser capturado
        x = 199;
        y = 0;
        //Tamanho do recorte a ser capturado
        largura = 60;
        altura = 60;
        // imprimindo a região cortada
        //Posicionamento do recorte capturado da imagem
        x_1 = 403;
        y_1 = 50;
        //Tamanho do recorte destino
        largura_1 = 60;
        altura_1 = 60;
        }
        /*====================================================================*/
        if ( a == 5 ) {
        //Posição do recorte a ser capturado
        x = 0;
        y = 67;
        //Tamanho do recorte a ser capturado
        largura = 60;
        altura = 60;
        // imprimindo a região cortada
        //Posicionamento do recorte capturado da imagem
        x_1 = 403;
        y_1 = 50;
        //Tamanho do recorte destino
        largura_1 = 60;
        altura_1 = 60;
    }
        /*====================================================================*/
        if ( a == 6 ) {
        //Posição do recorte a ser capturado
        x = 68;
        y = 67;
        //Tamanho do recorte a ser capturado
        largura = 60;
        altura = 60;
        // imprimindo a região cortada
        //Posicionamento do recorte capturado da imagem
        x_1 = 403;
        y_1 = 50;
        //Tamanho do recorte destino
        largura_1 = 60;
        altura_1 = 60;
    }
    /*====================================================================*/
    if ( a == 7 ) {
        //Posição do recorte a ser capturado
        x = 133;
        y = 67;
        //Tamanho do recorte a ser capturado
        largura = 60;
        altura = 60;
        // imprimindo a região cortada
        //Posicionamento do recorte capturado da imagem
        x_1 = 403;
        y_1 = 50;
        //Tamanho do recorte destino
        largura_1 = 60;
        altura_1 = 60;
    }
    /*====================================================================*/
        if ( a == 8 ) {
        //Posição do recorte a ser capturado
        x = 199;
        y = 67;
        //Tamanho do recorte a ser capturado
        largura = 60;
        altura = 60;
        // imprimindo a região cortada
        //Posicionamento do recorte capturado da imagem
        x_1 = 403;
        y_1 = 50;
        //Tamanho do recorte destino
        largura_1 = 60;
        altura_1 = 60;
    }
    /*====================================================================*/
        if ( a == 9 ) {
        //Posição do recorte a ser capturado
        x = 0;
        y = 134;
        //Tamanho do recorte a ser capturado
        largura = 60;
        altura = 60;
        // imprimindo a região cortada
        //Posicionamento do recorte capturado da imagem
        x_1 = 403;
        y_1 = 50;
        //Tamanho do recorte destino
        largura_1 = 60;
        altura_1 = 60;
    }
    /*====================================================================*/
    if ( a == 10 ) {
        //Posição do recorte a ser capturado
        x = 133;
        y = 134;
        //Tamanho do recorte a ser capturado
        largura = 60;
        altura = 60;
        // imprimindo a região cortada
        //Posicionamento do recorte capturado da imagem
        x_1 = 403;
        y_1 = 50;
        //Tamanho do recorte destino
        largura_1 = 60;
        altura_1 = 60;
    }
    /*====================================================================*/
        if ( a == 11 ) {
        //Posição do recorte a ser capturado
        x = 199;
        y = 134;
        //Tamanho do recorte a ser capturado
        largura = 60;
        altura = 60;
        // imprimindo a região cortada
        //Posicionamento do recorte capturado da imagem
        x_1 = 403;
        y_1 = 50;
        //Tamanho do recorte destino
        largura_1 = 60;
        altura_1 = 60;
    }
    /*====================================================================*/
    Canvas -> CopyRect (
            //o primeiro ret é o destino
            TRect ( x_1, y_1, x_1 + largura_1, y_1 + altura_1 )
            //segundo é a tela da fonte
            ,bitimap -> Canvas
            //terceiro é o retângulo da fonte que desejamos copiar
            ,TRect ( x, y, x + largura, y + altura )
    );
}
//---------------------------------------------------------------------------
void __fastcall TForm1::OnPaint(TObject *Sender)
{
    bitimap = new Graphics::TBitmap ( );
    bitimap -> Width = 200;
    bitimap -> Height = 200;
    bitimap -> LoadFromFile ("C:\\Users\\ManMachine\\Downloads\\"
            "\\Contador personalizado manual\\números.bmp" );
                Canvas -> Pen -> Width = 10;
    Canvas -> Pen -> Color = clRed;
    Canvas -> Rectangle ( 05, 05, 595, 295 );
    Canvas -> Font -> Size = 14;
    Canvas -> Font -> Name = "arial";
    Canvas -> Font -> Color = clRed;
    Canvas -> Font-> Style = TFontStyles ( ) << fsBold << fsItalic << fsUnderline;
    Canvas -> TextOut ( 110, 12, "DESENHANDO PARTES DE UMA IMAGEM" );
}
//---------------------------------------------------------------------------
void __fastcall TForm1::OnTimer(TObject *Sender)
{
   if ( a == 12 ) {
      Informe ( Sender );
    }
    if ( a == 13 ) {
       Form1 -> Close ( );
    }
}
//---------------------------------------------------------------------------



//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.ExtCtrls.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:    // IDE-managed Components
    TButton *Button1;
    TButton *Button2;
    TLabel *Label1;
    TTimer *Timer1;
    void __fastcall Informe ( TObject *Sender );
    void __fastcall Button2Click(TObject *Sender);
    void __fastcall Button1Click(TObject *Sender);
    void __fastcall OnPaint(TObject *Sender);
    void __fastcall OnTimer(TObject *Sender);
private:    // User declarations
public:        // User declarations
    __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif



object Form1: TForm1
  Left = 455
  Top = 89
  Caption = 'DESENHANDO PARTES DE UMA IMAGEM'
  ClientHeight = 300
  ClientWidth = 600
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  Position = poDesigned
  OnPaint = OnPaint
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel
    Left = 376
    Top = 144
    Width = 46
    Height = 81
    Caption = ' '
    Font.Charset = ANSI_CHARSET
    Font.Color = clRed
    Font.Height = -77
    Font.Name = 'alarm clock'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Button1: TButton
    Left = 104
    Top = 259
    Width = 75
    Height = 25
    Caption = 'Imagem'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 0
    OnClick = Button1Click
  end
  object Button2: TButton
    Left = 440
    Top = 259
    Width = 75
    Height = 25
    Caption = 'Draw'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 1
    OnClick = Button2Click
  end
  object Timer1: TTimer
    Interval = 2000
    OnTimer = OnTimer
    Left = 536
    Top = 24
  end
end


segunda-feira, 23 de setembro de 2019

C++ Builder - Calculando hipotenusa

O Teorema de Pitágoras é considerado uma das
principais descobertas da Matemática.
Ele descreve uma relação existente no triângulo retângulo.
Vale lembrar que o triângulo retângulo pode ser identificado
pela existência de um ângulo reto, isto é, que mede 90º.
O triângulo retângulo é formado por dois catetos e a hipotenusa,
que constitui o maior segmento do triângulo
e localiza-se opostamente ao ângulo reto, e sua fórmula é esta abaixo:
Cateto a² + Cateto b² = h²
O Teorema de Pitágoras diz que:
“a soma dos quadrados dos catetos é igual ao quadrado da hipotenusa.”

Fonte: https://brasilescola.uol.com.br/matematica/teorema-pitagoras.html

Partindo destas informações ficou muito fácil
converter sua fórmula matemática em uma equação
em que o computador possa entender, e foi o que fizemos.
Na verdade isto é muito simples, e nos foi ensinado
quando estávamos dando nossos primeiros passos no mundo
maravilhoso da programação, a única diferença é que aqui,
estamos utilizando uma janela gráfica feita no
C++ Builder da Embarcadero, e eu estou usando a versão 10.3.
É uma pena que muitos não conhecem o poder desta ferramenta
profissional que pertencia no início a Borland,
mas de alguns anos para hoje pertence a Embarcadero,
e na minha opinião é a melhor opção para quem estuda
linguagem C ou C++, e não quer mudar de linguagem,
por estar familiarizado com suas sintaxes.


Veja abaixo um vídeo com o programa em execução:




//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop
#include <math.h>
#include "Unit1.h"
#include <memory>
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
    : TForm(Owner)
{
}
 //---------------------------------------------------------------------------
void __fastcall TForm1::Informe ( TObject *Sender ) {
    Canvas -> Font -> Size = 14;
    Canvas -> Font -> Color = clBlack;
    Canvas -> TextOut ( 200, 240, "Por: " );
    Canvas -> Font -> Color = clRed;
    Canvas -> TextOut ( 240, 240, "Samuel Lima" );
    Canvas -> Font -> Color = clBlack;
    Canvas -> Font -> Name = "Garamond";
    Canvas -> Font -> Size = 14;
    Canvas -> Font -> Color = clSkyBlue;
    Canvas -> TextOut ( 196, 266, "sa_sp10@hotmail.com" );
    SetBkMode ( Canvas -> Handle, TRANSPARENT );
    Canvas -> Font -> Color = clBlue;
    Canvas -> TextOut ( 190, 260, "sa_sp10@hotmail.com" );
}
//---------------------------------------------------------------------------
void __fastcall TForm1::FormPaint(TObject *Sender)
{
     Canvas -> Pen -> Width = 10;
    Canvas -> Pen -> Color = clRed;
    Canvas -> Rectangle ( 05, 05, 595, 295 );
    Canvas -> Font -> Size = 14;
    Canvas -> Font -> Name = "arial";
    Canvas -> Font -> Color = clRed;
    Canvas -> Font-> Style = TFontStyles ( ) << fsBold << fsItalic << fsUnderline;
    Canvas -> TextOut ( 180, 12, "CALCULANDO HIPOTENUSA" );
    Informe ( Sender );
}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button1Click(TObject *Sender)
{
  double c1 = 0.00, c2 = 0.00, h = 0.00;
  c1 = StrToFloat ( Edit1 -> Text );
  c2 = StrToFloat ( Edit2 -> Text );
  h = sqrt ( pow ( c1, 2 ) + pow ( c2, 2 ) );
  Edit3 -> Text = FloatToStrF ( h, ffFixed, 2, 2 );
  Image1->Picture->LoadFromFile("C:\\Users\\ManMachine\\Downloads\\"
    "\\Calculando hipotenusa\\trianguloReto.bmp");

}
//---------------------------------------------------------------------------

void __fastcall TForm1::Button2Click(TObject *Sender)
{
 Form1 -> Close ( );
}
//---------------------------------------------------------------------------



//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.ExtCtrls.hpp>
#include <Vcl.Imaging.pngimage.hpp>
#include <Vcl.Graphics.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published:    // IDE-managed Components
    TEdit *Edit1;
    TEdit *Edit2;
    TBevel *Bevel1;
    TEdit *Edit3;
    TLabel *Label1;
    TLabel *Label2;
    TLabel *Label3;
    TButton *Button1;
    TButton *Button2;
    TBevel *Bevel2;
    TImage *Image1;
    void __fastcall Informe ( TObject *Sender );
    void __fastcall FormPaint(TObject *Sender);
    void __fastcall Button1Click(TObject *Sender);
    void __fastcall Button2Click(TObject *Sender);
private:    // User declarations
public:        // User declarations
    __fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif



object Form1: TForm1
  Left = 455
  Top = 177
  Caption = 'CALCULANDO HIPOTENUSA'
  ClientHeight = 300
  ClientWidth = 600
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  Position = poDesigned
  OnPaint = FormPaint
  PixelsPerInch = 96
  TextHeight = 13
  object Bevel1: TBevel
    Left = 32
    Top = 47
    Width = 265
    Height = 186
  end
  object Label1: TLabel
    Left = 55
    Top = 70
    Width = 56
    Height = 16
    Caption = 'Cateto 1'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label2: TLabel
    Left = 55
    Top = 108
    Width = 56
    Height = 16
    Caption = 'Cateto 2'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Label3: TLabel
    Left = 55
    Top = 151
    Width = 73
    Height = 16
    Caption = 'Hipotenusa'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
  end
  object Bevel2: TBevel
    Left = 312
    Top = 47
    Width = 265
    Height = 170
  end
  object Image1: TImage
    Left = 328
    Top = 64
    Width = 233
    Height = 137
  end
  object Edit1: TEdit
    Left = 152
    Top = 69
    Width = 121
    Height = 24
    Alignment = taRightJustify
    Color = clOlive
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 0
    Text = ' '
  end
  object Edit2: TEdit
    Left = 152
    Top = 107
    Width = 121
    Height = 24
    Alignment = taRightJustify
    Color = clOlive
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 1
    Text = ' '
  end
  object Edit3: TEdit
    Left = 152
    Top = 150
    Width = 121
    Height = 24
    Alignment = taRightJustify
    Color = clOlive
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 2
    Text = ' '
  end
  object Button1: TButton
    Left = 53
    Top = 192
    Width = 75
    Height = 25
    Caption = 'Calcular'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 3
    OnClick = Button1Click
  end
  object Button2: TButton
    Left = 198
    Top = 192
    Width = 75
    Height = 25
    Caption = 'Sair'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -13
    Font.Name = 'Tahoma'
    Font.Style = [fsBold]
    ParentFont = False
    TabOrder = 4
    OnClick = Button2Click
  end
end

segunda-feira, 3 de junho de 2019

C++ builder - Pesquisando em matriz de inteiros

Este programa foi criado no C++ builder,
e oferece aos usuários uma precisa e rápida
pesquisa em valores armazenados numa matriz 
de inteiros, é indicado aos iniciantes em C/C++,
Que estão utilizando esta poderosa IDE
da Embarcadero, que é sem dúvidas a melhor
opção para criação de janelas em C++.





//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;

AnsiString str_1;
AnsiString str_2;
int n;
int a = 0, b = 0;
int A [ 10 ] [ 10 ], i;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
   //Limpa o Edit na entrada
{  Edit1 -> Clear ( );
}
 //---------------------------------------------------------------------------
void __fastcall TForm1::Informe ( TObject *Sender ) {
Canvas -> Font -> Size = 14;
Canvas -> Font -> Color = clBlack;
Canvas -> TextOut ( 200, 240, "Por: " );
Canvas -> Font -> Color = clRed;
Canvas -> TextOut ( 240, 240, "Samuel Lima" );
Canvas -> Font -> Color = clBlack;
    Canvas -> Font -> Name = "Garamond";
Canvas -> Font -> Size = 14;
Canvas -> Font -> Color = clSkyBlue;
Canvas -> TextOut ( 196, 266, "sa_sp10@hotmail.com" );
SetBkMode ( Canvas -> Handle, TRANSPARENT );
Canvas -> Font -> Color = clBlue;
Canvas -> TextOut ( 190, 260, "sa_sp10@hotmail.com" );
}
//---------------------------------------------------------------------------
void __fastcall TForm1::OnCreate(TObject *Sender)
{
for( i = 0; i < 100; i++ ) {
A [ b ] [ a ] =  i;
a++;
}
for ( a = 0; a < 10; a++ ) {
for ( b = 0; b < 10; b++ ) {

AppendStr ( str_1, "\t" );

if ( A [ a ] [ b ] % 10 == 0 ) {
AppendStr ( str_1, "\n" );
}

if ( A [ a ] [ b ] >= 0 && A [ a ] [ b ] < 10 ) {
AppendStr ( str_1, "0" );
}
   AppendStr ( str_1, A [ a ] [ b ] );
}
}
Label1 -> Caption = str_1;
}
//---------------------------------------------------------------------------
void __fastcall TForm1::OnPaint(TObject *Sender)
{
Canvas -> Pen -> Color = clBlue;
Canvas -> Brush -> Color = static_cast < TColor > ( RGB ( 0,255,255 ) );
Canvas -> Pen -> Width = 10;
Canvas -> Rectangle ( 05, 05, 595, 295 );
Canvas -> Font -> Size = 14;
Canvas -> Font -> Name = "arial";
Canvas -> Font -> Color = clRed;
Canvas -> TextOut ( 148, 15, "PESQUISA EM MATRIZ DE INTEIROS" );

Canvas -> Font -> Size = 8;
Canvas -> Font -> Name = "arial";
Canvas -> Font -> Color = clBlack;
Canvas -> TextOut ( 40, 245, "Pesquisa" );
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click(TObject *Sender)
{
n = StrToInt ( Edit1 -> Text );
if ( n > 99 ) {
  Beep ( 1000, 500 );
}
Label1 -> Caption = " ";
str_1 = " ";
str_2 = " ";
for ( a = 0; a < 10; a++ ) {
for ( b = 0; b < 10; b++ ) {

AppendStr ( str_1, "\t" );
AppendStr ( str_2, "\t" );

if ( A [ a ] [ b ] % 10 == 0 ) {
AppendStr ( str_1, "\n" );
AppendStr ( str_2, "\n" );
}

if ( A [ a ] [ b ] >= 0 && A [ a ] [ b ] < 10 ) {
AppendStr ( str_1, "0" );
   if ( n > 0 && n < 10 && A [ a ] [ b ] == n )
   AppendStr ( str_2, "0" );
}

   AppendStr ( str_1, A [ a ] [ b ] );
   if ( n > 0 )
if ( A [ a ] [ b ] == n ) {
AppendStr ( str_2, n );
}
}
}
Label1 -> Caption = str_1;
Label2 -> Caption = str_2;
//Limpa o Edit para uma nova pesquisa
Edit1 -> Clear ( );
//Posiciona o cusrsor do Edit para uma nova pesquisa
Edit1 -> SetFocus ( );
Informe ( Sender );
}
//---------------------------------------------------------------------------


//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TLabel *Label1;
TLabel *Label2;
TEdit *Edit1;
    TButton *Button1;
void __fastcall OnPaint(TObject *Sender);
void __fastcall Button1Click(TObject *Sender);
void __fastcall OnCreate(TObject *Sender);
    void __fastcall Informe ( TObject *Sender );
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif


object Form1: TForm1
  Left = 398
  Top = 133
  Caption = 'PESQUISA EM MATRIZ DE INTEIROS'
  ClientHeight = 300
  ClientWidth = 600
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  Position = poDesigned
  OnCreate = OnCreate
  OnPaint = OnPaint
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel
    Left = 36
    Top = 28
    Width = 5
    Height = 19
    Caption = ' '
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clBlack
    Font.Height = -16
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
  end
  object Label2: TLabel
    Left = 36
    Top = 28
    Width = 5
    Height = 19
    Caption = ' '
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clRed
    Font.Height = -16
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
  end
  object Edit1: TEdit
    Left = 36
    Top = 261
    Width = 53
    Height = 26
    AutoSelect = False
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -15
    Font.Name = 'Tahoma'
    Font.Style = []
    NumbersOnly = True
    ParentFont = False
    TabOrder = 0
    Text = ' '
  end
  object Button1: TButton
    Left = 95
    Top = 261
    Width = 34
    Height = 25
    Caption = 'Ok'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -15
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 1
    OnClick = Button1Click
  end
end

quinta-feira, 16 de maio de 2019

C++ builder - de inteiro para hex e bin

Este programa feito no C++ builder,
converte números inteiros em Hexadecimal
e binário, mas pode ser expandido 
para cálculos diversos graças ao teclado 
numérico que criamos utilizando botões
e programando rotinas de códigos para
acionamento dos eventos chamados pelo
click do mouse, ou na entrada pelo teclado.
Não vou detalhar como fiz mas deixo postado
os códigos para quem tiver interesse
em testar este ótimo programa.


#include <vcl.h>
#include <stdio.h>
#include <ctype.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
AnsiString Dest;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1( TComponent* Owner )
: TForm ( Owner )
{
 Memo1 -> Enabled = false;
 Memo1 -> Visible = false;
}
class Convert_Dec_Bin {
public:
const static int DEC = 1;
int DecBin( int dec ){
int bin = 0, tp = 1;
while ( dec > 0 ){
bin = bin + ( dec % 2 ) * tp;
dec = dec / 2;
tp *= 10;
}
return bin;
}
};
//---------------------------------------------------------------------------
void __fastcall TForm1::Button1Click ( TObject *Sender )
{
 Memo1 -> Enabled = false;
 Memo1 -> Visible = false;
 int i = 0, um = 0;
  um++;
  char str [ ] = "1";
  while ( i < 10 ) {
AppendStr ( Dest, str );
Edit1 -> Text = Dest;
i++;
break;
  }
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button13Click ( TObject *Sender )
{
int StrInt;
StrInt = StrToInt ( Edit1 -> Text );
Convert_Dec_Bin conv;
int x = Edit1 -> Text.ToIntDef ( 0 );
int conversor = conv.DecBin ( x );
if ( x > 0 ) {
Edit1 -> Text = conversor;
} else {
Edit1 -> Clear ( );
}
Edit1 -> SetFocus ( );
Dest = "";
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button14Click ( TObject *Sender )
{
String inf = "   Criado por: Samuel Lima\n\n";
String inf_1 = "        MUITO OBRIGADO";
Memo1 -> Enabled = true;
Memo1 -> Visible = true;
Memo1 -> Lines -> Strings [ 0 ] = inf;
Memo1 -> Lines -> Strings [ 1 ] = inf_1;
Sleep ( 2800 );
exit ( 0 );
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button2Click ( TObject *Sender )
{
int StrInt;
StrInt = StrToInt ( Edit1 -> Text );
Edit1 -> Text = IntToHex ( StrInt, 1 );
Dest = "";
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button3Click ( TObject *Sender )
{
 Memo1 -> Enabled = false;
 Memo1 -> Visible = false;
 int i = 0, um = 0;
  um++;
  char str [ ] = "2";
  while ( i < 10 ) {
AppendStr ( Dest, str );
Edit1 -> Text = Dest;
i++;
break;
  }
}
//---------------------------------------------------------------------------
 void __fastcall TForm1::Button4Click ( TObject *Sender )
{
 Memo1 -> Enabled = false;
 Memo1 -> Visible = false;
 int i = 0, um = 0;
  um++;
  char str [ ] = "3";
  while ( i < 10 ) {
AppendStr ( Dest, str );
Edit1 -> Text = Dest;
i++;
break;
  }
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button5Click ( TObject *Sender )
{
 Memo1 -> Enabled = false;
 Memo1 -> Visible = false;
 int i = 0, um = 0;
  um++;
  char str [ ] = "4";
  while ( i < 10 ) {
AppendStr ( Dest, str );
Edit1 -> Text = Dest;
i++;
break;
  }
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button6Click ( TObject *Sender )
{
 Memo1 -> Enabled = false;
 Memo1 -> Visible = false;
 int i = 0, um = 0;
  um++;
  char str [ ] = "5";
  while ( i < 10 ) {
AppendStr ( Dest, str );
Edit1 -> Text = Dest;
i++;
break;
  }
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button7Click ( TObject *Sender )
{
 Memo1 -> Enabled = false;
 Memo1 -> Visible = false;
 int i = 0, um = 0;
  um++;
  char str [ ] = "6";
  while ( i < 10 ) {
AppendStr ( Dest, str );
Edit1 -> Text = Dest;
i++;
break;
  }
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button8Click ( TObject *Sender )
{
 Memo1 -> Enabled = false;
 Memo1 -> Visible = false;
 int i = 0, um = 0;
  um++;
  char str [ ] = "7";
  while ( i < 10 ) {
AppendStr ( Dest, str );
Edit1 -> Text = Dest;
i++;
break;
  }
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button9Click ( TObject *Sender )
{
 Memo1 -> Enabled = false;
 Memo1 -> Visible = false;
 int i = 0, um = 0;
  um++;
  char str [ ] = "8";
  while ( i < 10 ) {
AppendStr ( Dest, str );
Edit1 -> Text = Dest;
i++;
break;
  }
}
//---------------------------------------------------------------------------
 void __fastcall TForm1::Button10Click ( TObject *Sender )
{
 Memo1 -> Enabled = false;
 Memo1 -> Visible = false;
 int i = 0, um = 0;
  um++;
  char str [ ] = "9";
  while ( i < 10 ) {
AppendStr ( Dest, str );
Edit1 -> Text = Dest;
i++;
break;
  }
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button11Click ( TObject *Sender )
{
 Memo1 -> Enabled = false;
 Memo1 -> Visible = false;
 int i = 0, um = 0;
  um++;
  char str [ ] = "0";
  while ( i < 10 ) {
AppendStr ( Dest, str );
Edit1 -> Text = Dest;
i++;
break;
  }
}
//---------------------------------------------------------------------------
void __fastcall TForm1::Button12Click ( TObject *Sender )
{
Edit1 -> Clear ( );
Edit1 -> Text = "0";
Dest = "";
Edit1 -> SetFocus ( );
}
//---------------------------------------------------------------------------
void __fastcall TForm1::OnPaint ( TObject *Sender )
{
 Canvas -> Font -> Size = 13;
 Canvas -> Font -> Name = "Arial";
 Canvas -> Font -> Style = TFontStyles ( ) << fsBold;
 //Colorindo a janela
 Canvas -> Brush -> Color = static_cast < TColor > ( RGB ( 0, 255, 255 ) );
 Canvas -> Pen -> Width = 10;
 Canvas -> Pen -> Color = clBlack;
 Canvas -> Rectangle ( 05, 05, 315, 213 );
 Canvas -> Font -> Color = clRed;
 Canvas -> TextOut ( 42, 10, "DE INTEIRO PARA HEX E BIN" );
Form1 -> Constraints -> MaxHeight = 255;
Form1 -> Constraints -> MaxWidth = 335;
}
//---------------------------------------------------------------------------


//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.Buttons.hpp>
#include <Vcl.ExtCtrls.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
TLabel *Label1;
TLabel *Label2;
TEdit *Edit1;
TShape *Shape1;
TButton *Button1;
TButton *Button2;
TButton *Button3;
TButton *Button4;
TButton *Button5;
TButton *Button6;
TButton *Button7;
TButton *Button8;
TButton *Button9;
TButton *Button10;
TButton *Button11;
TButton *Button12;
TButton *Button13;
TButton *Button14;
TMemo *Memo1;

void __fastcall Button1Click(TObject *Sender);
void __fastcall Button2Click(TObject *Sender);
void __fastcall Button3Click(TObject *Sender);
void __fastcall Button4Click(TObject *Sender);
void __fastcall Button5Click(TObject *Sender);
void __fastcall Button6Click(TObject *Sender);
void __fastcall Button7Click(TObject *Sender);
void __fastcall Button8Click(TObject *Sender);
void __fastcall Button9Click(TObject *Sender);
void __fastcall Button10Click(TObject *Sender);
void __fastcall Button11Click(TObject *Sender);
void __fastcall Button12Click(TObject *Sender);
void __fastcall Button13Click(TObject *Sender);
void __fastcall Button14Click(TObject *Sender);

void __fastcall OnPaint(TObject *Sender);

private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif


object Form1: TForm1
  Left = 541
  Top = 118
  Caption = 'DE INTEIRO PARA HEXADECIMAL'
  ClientHeight = 217
  ClientWidth = 317
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  Position = poDesigned
  Visible = True
  OnPaint = OnPaint
  DesignSize = (
    317
    217)
  PixelsPerInch = 96
  TextHeight = 13
  object Label1: TLabel
    Left = 304
    Top = 96
    Width = 5
    Height = 21
    Caption = ' '
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -17
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
  end
  object Label2: TLabel
    Left = 320
    Top = 96
    Width = 5
    Height = 21
    Caption = ' '
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clRed
    Font.Height = -17
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
  end
  object Shape1: TShape
    Left = 23
    Top = 33
    Width = 275
    Height = 77
    Brush.Style = bsClear
    Pen.Color = clBlue
    Pen.Width = 5
  end
  object Button1: TButton
    Left = 22
    Top = 115
    Width = 41
    Height = 25
    Caption = '1'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -19
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 0
    OnClick = Button1Click
  end
  object Button2: TButton
    Left = 210
    Top = 146
    Width = 41
    Height = 25
    Caption = 'H'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -19
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 2
    OnClick = Button2Click
  end
  object Edit1: TEdit
    AlignWithMargins = True
    Left = 28
    Top = 38
    Width = 265
    Height = 68
    Alignment = taRightJustify
    Anchors = []
    AutoSelect = False
    AutoSize = False
    BevelWidth = 10
    Color = clOlive
    Font.Charset = ANSI_CHARSET
    Font.Color = clWindowText
    Font.Height = -21
    Font.Name = 'Arial'
    Font.Style = [fsItalic]
    NumbersOnly = True
    ParentFont = False
    TabOrder = 1
    Text = '0'
  end
  object Button3: TButton
    Left = 69
    Top = 115
    Width = 41
    Height = 25
    Caption = '2'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -19
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 3
    OnClick = Button3Click
  end
  object Button4: TButton
    Left = 116
    Top = 115
    Width = 41
    Height = 25
    Caption = '3'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -19
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 4
    OnClick = Button4Click
  end
  object Button5: TButton
    Left = 163
    Top = 115
    Width = 41
    Height = 25
    Caption = '4'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -19
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 5
    OnClick = Button5Click
  end
  object Button6: TButton
    Left = 210
    Top = 115
    Width = 41
    Height = 25
    Caption = '5'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -19
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 6
    OnClick = Button6Click
  end
  object Button7: TButton
    Left = 257
    Top = 115
    Width = 41
    Height = 25
    Caption = '6'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -19
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 7
    OnClick = Button7Click
  end
  object Button8: TButton
    Left = 22
    Top = 146
    Width = 41
    Height = 25
    Caption = '7'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -19
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 8
    OnClick = Button8Click
  end
  object Button9: TButton
    Left = 69
    Top = 146
    Width = 41
    Height = 25
    Caption = '8'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -19
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 9
    OnClick = Button9Click
  end
  object Button10: TButton
    Left = 116
    Top = 146
    Width = 41
    Height = 25
    Caption = '9'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -19
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 10
    OnClick = Button10Click
  end
  object Button11: TButton
    Left = 163
    Top = 146
    Width = 41
    Height = 25
    Caption = '0'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -19
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 11
    OnClick = Button11Click
  end
  object Button12: TButton
    Left = 257
    Top = 146
    Width = 41
    Height = 25
    Caption = 'CR'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -19
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 12
    OnClick = Button12Click
  end
  object Button13: TButton
    Left = 23
    Top = 177
    Width = 41
    Height = 25
    Caption = 'B'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -19
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 13
    OnClick = Button13Click
  end
  object Button14: TButton
    Left = 70
    Top = 177
    Width = 228
    Height = 25
    Caption = 'Sair do programa'
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -19
    Font.Name = 'Tahoma'
    Font.Style = []
    ParentFont = False
    TabOrder = 14
    OnClick = Button14Click
  end
  object Memo1: TMemo
    Left = 28
    Top = 38
    Width = 265
    Height = 68
    Color = clOlive
    Enabled = False
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -19
    Font.Name = 'Tahoma'
    Font.Style = []
    Lines.Strings = (
      ' ')
    ParentFont = False
    TabOrder = 15
  end
end


sábado, 4 de maio de 2019

C++ builder - criando tabuada

Esta tabuada usa uma janela gráfica
feita no Embarcadero C++ Builder,
se você usa esta poderosa IDE,
não deixe de testar este código,
quem é oferecido aos iniciantes de C/C++.



//---------------------------------------------------------------------------

#include <vcl.h>
#pragma hdrstop

#include "Unit1.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1(TComponent* Owner)
: TForm(Owner)
{
}

//---------------------------------------------------------------------------
int y = 1;
void __fastcall TForm1::OnPaint ( TObject *Sender ) {
 Canvas -> Font -> Style = TFontStyles() << fsBold << fsUnderline << fsItalic;
 Canvas -> Font -> Size = 16;
 Canvas -> Font -> Name = "Arial";
 Canvas -> Brush -> Color = static_cast <TColor> ( RGB ( 0, 191, 255 ) );
 Canvas -> Pen -> Width = 10;
 Canvas -> Rectangle ( 05, 05, 610, 465 );
 SetTextColor ( Canvas->Handle, RGB ( 255, 25, 2 ) );
 Canvas -> TextOut ( 140, 10, "C++ BUILDER - CRIANDO TABUADA" );
int i = 0, x = 0, k = 0, w = 0;
String str_1;
String str_2;
String str_3;
     do {
x = 1;
for ( i = 1; i <= 10; i++ ) {
   k = y;
   w = k * x;
   str_1 = k;
   str_2 = x;
   str_3 = w;
   if ( k == 1 ) {
ListBox1 -> Items -> Add ( str_1 + " " + "x" +
" " + str_2 + " " + "=" + " " + str_3 );
   }
   if ( k == 2 ) {
   ListBox2 -> Items -> Add ( str_1 + " " + "x" +
" " + str_2 + " " + "=" + " " + str_3 );
   }
   if ( k == 3 ) {
ListBox3 -> Items -> Add ( str_1 + " " + "x" +
" " + str_2 + " " + "=" + " " + str_3 );
   }
   if ( k == 4 ) {
   ListBox4 -> Items -> Add ( str_1 + " " + "x" +
" " + str_2 + " " + "=" + " " + str_3 );
   }
   if ( k == 5 ) {
   ListBox5 -> Items -> Add ( str_1 + " " + "x" +
" " + str_2 + " " + "=" + " " + str_3 );
   }
   if ( k == 6 ) {
ListBox6 -> Items -> Add ( str_1 + " " + "x" +
" " + str_2 + " " + "=" + " " + str_3 );
   }
   if ( k == 7 ) {
   ListBox7 -> Items -> Add ( str_1 + " " + "x" +
" " + str_2 + " " + "=" + " " + str_3 );
   }
   if ( k == 8 ) {
ListBox8 -> Items -> Add ( str_1 + " " + "x" +
" " + str_2 + " " + "=" + " " + str_3 );
   }
   if ( k == 9 ) {
   ListBox9 -> Items -> Add ( str_1 + " " + "x" +
" " + str_2 + " " + "=" + " " + str_3 );
   }
   if ( k == 10 ) {
   ListBox10 -> Items -> Add ( str_1 + " " + "x" +
" " + str_2 + " " + "=" + " " + str_3 );
   }
   i++;
   //ShowMessage ( "Pressione o botão OK" );
                   x++;
              i = i - 1;
}
         y++;
} while ( y <= 10 );
}
//---------------------------------------------------------------------------



//---------------------------------------------------------------------------

#ifndef Unit1H
#define Unit1H
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include <Vcl.ExtCtrls.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
    TListBox *ListBox1;
TListBox *ListBox2;
TListBox *ListBox3;
TListBox *ListBox4;
TListBox *ListBox5;
TListBox *ListBox6;
TListBox *ListBox7;
TListBox *ListBox8;
TListBox *ListBox9;
TListBox *ListBox10;
void __fastcall OnPaint(TObject *Sender);
private: // User declarations
public: // User declarations
__fastcall TForm1(TComponent* Owner);
};
//---------------------------------------------------------------------------
extern PACKAGE TForm1 *Form1;
//---------------------------------------------------------------------------
#endif


object Form1: TForm1
  Left = 0
  Top = 0
  Caption = 'C++ BUILDER - CRIANDO TABUADA'
  ClientHeight = 469
  ClientWidth = 614
  Color = clBtnFace
  Font.Charset = DEFAULT_CHARSET
  Font.Color = clWindowText
  Font.Height = -11
  Font.Name = 'Tahoma'
  Font.Style = []
  OldCreateOrder = False
  OnPaint = OnPaint
  PixelsPerInch = 96
  TextHeight = 13
  object ListBox1: TListBox
    Left = 24
    Top = 40
    Width = 97
    Height = 201
    Color = clAqua
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Tahoma'
    Font.Style = [fsItalic]
    ItemHeight = 19
    ParentFont = False
    TabOrder = 0
  end
  object ListBox2: TListBox
    Left = 135
    Top = 40
    Width = 97
    Height = 201
    Color = clAqua
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Tahoma'
    Font.Style = [fsItalic]
    ItemHeight = 19
    ParentFont = False
    TabOrder = 1
  end
  object ListBox3: TListBox
    Left = 248
    Top = 40
    Width = 97
    Height = 201
    Color = clAqua
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Tahoma'
    Font.Style = [fsItalic]
    ItemHeight = 19
    ParentFont = False
    TabOrder = 2
  end
  object ListBox4: TListBox
    Left = 360
    Top = 40
    Width = 97
    Height = 201
    Color = clAqua
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Tahoma'
    Font.Style = [fsItalic]
    ItemHeight = 19
    ParentFont = False
    TabOrder = 3
  end
  object ListBox5: TListBox
    Left = 472
    Top = 40
    Width = 120
    Height = 201
    Color = clAqua
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Tahoma'
    Font.Style = [fsItalic]
    ItemHeight = 19
    ParentFont = False
    TabOrder = 4
  end
  object ListBox6: TListBox
    Left = 24
    Top = 256
    Width = 97
    Height = 201
    Color = clAqua
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Tahoma'
    Font.Style = [fsItalic]
    ItemHeight = 19
    ParentFont = False
    TabOrder = 5
  end
  object ListBox7: TListBox
    Left = 135
    Top = 256
    Width = 97
    Height = 201
    Color = clAqua
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Tahoma'
    Font.Style = [fsItalic]
    ItemHeight = 19
    ParentFont = False
    TabOrder = 6
  end
  object ListBox8: TListBox
    Left = 248
    Top = 256
    Width = 97
    Height = 201
    Color = clAqua
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Tahoma'
    Font.Style = [fsItalic]
    ItemHeight = 19
    ParentFont = False
    TabOrder = 7
  end
  object ListBox9: TListBox
    Left = 360
    Top = 256
    Width = 97
    Height = 201
    Color = clAqua
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Tahoma'
    Font.Style = [fsItalic]
    ItemHeight = 19
    ParentFont = False
    TabOrder = 8
  end
  object ListBox10: TListBox
    Left = 472
    Top = 256
    Width = 120
    Height = 201
    Color = clAqua
    Font.Charset = DEFAULT_CHARSET
    Font.Color = clWindowText
    Font.Height = -16
    Font.Name = 'Tahoma'
    Font.Style = [fsItalic]
    ItemHeight = 19
    ParentFont = False
    TabOrder = 9
  end
end