sábado, 26 de janeiro de 2019

FMX - Matriz bidimensional de caracteres






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

#include <fmx.h>
#pragma hdrstop

#include "OnShow.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.fmx"
#define tam 20
TForm1 *Form1;
//---------------------------------------------------------------------------
__fastcall TForm1::TForm1 ( TComponent* Owner ) :
TForm ( Owner ) {
}

void __fastcall TForm1::OnShow ( TObject *Sender ) {
String str_1 = "";
String str_2 = "";
Label1->Text = "Memo - Matriz bidimensional de caracteres";
char caracteres [ 5 ] [ 5 ] =
  {{ 'A', 'B', 'C', 'D', 'E'},
  { 'F', 'G', 'H', 'I', 'J' },
  { 'L', 'M', 'N', 'O', 'P' },
  { 'Q', 'R', 'S', 'T', 'U' },
  { 'V', 'X', 'Z', 'Y', 'K' } };
int i, j;
for ( i = 0; i < 5; i++ ) {
if ( i % 1 == 0 )
str_1 += "\n";
for ( j = 0; j < 5; j++ ) {
if ( j % 1 == 0 )
str_1 += "\t";
str_1 += caracteres  [  i  ]  [  j  ];
}
}
Memo1->Text = Memo1->Text + AnsiString ( str_1 );
Memo1->SelStart = 0;
Text1->Text = "Por: Samuel Lima";
}

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

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

#ifndef OnShowH
#define OnShowH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <FMX.Controls.hpp>
#include <FMX.Forms.hpp>
#include <FMX.Objects.hpp>
#include <FMX.Types.hpp>
#include <FMX.Controls.Presentation.hpp>
#include <FMX.Memo.hpp>
#include <FMX.ScrollBox.hpp>
#include <FMX.StdCtrls.hpp>
//---------------------------------------------------------------------------
class TForm1 : public TForm
{
__published: // IDE-managed Components
 TLabel *Label1;
 TRoundRect *RoundRect1;
 TText *Text1;
TMemo *Memo1;
TRectangle *Rectangle1;
TRectangle *Rectangle2;
 void __fastcall OnShow(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 = 'Memo - Matriz bidimensional de caracteres'
  ClientHeight = 302
  ClientWidth = 600
  FormFactor.Width = 320
  FormFactor.Height = 480
  FormFactor.Devices = [Desktop]
  OnShow = OnShow
  DesignerMasterStyle = 0
  object Label1: TLabel
    StyledSettings = [Family]
    Position.X = 128.000000000000000000
    Position.Y = 8.000000000000000000
    Size.Width = 393.000000000000000000
    Size.Height = 25.000000000000000000
    Size.PlatformDefault = False
    TextSettings.Font.Size = 18.000000000000000000
    TextSettings.Font.StyleExt = {00070000000200000004000000}
    TextSettings.FontColor = claCrimson
    TabOrder = 1
  end
  object RoundRect1: TRoundRect
    Fill.Kind = None
    Position.X = 184.000000000000000000
    Position.Y = 232.000000000000000000
    Size.Width = 249.000000000000000000
    Size.Height = 41.000000000000000000
    Size.PlatformDefault = False
    Stroke.Color = claDarkorchid
    Stroke.Thickness = 2.000000000000000000
  end
  object Text1: TText
    Position.X = 192.000000000000000000
    Position.Y = 240.000000000000000000
    Size.Width = 225.000000000000000000
    Size.Height = 25.000000000000000000
    Size.PlatformDefault = False
    TextSettings.Font.Size = 22.000000000000000000
    TextSettings.Font.StyleExt = {00040000000200000004000000}
    TextSettings.FontColor = claBlue
  end
  object Memo1: TMemo
    Touch.InteractiveGestures = [Pan, LongTap, DoubleTap]
    DataDetectorTypes = []
    Position.X = 120.000000000000000000
    Position.Y = 40.000000000000000000
    Size.Width = 385.000000000000000000
    Size.Height = 169.000000000000000000
    Size.PlatformDefault = False
    TabOrder = 2
    Viewport.Width = 381.000000000000000000
    Viewport.Height = 165.000000000000000000
  end
  object Rectangle1: TRectangle
    Fill.Kind = None
    Position.X = 120.000000000000000000
    Position.Y = 40.000000000000000000
    Size.Width = 385.000000000000000000
    Size.Height = 169.000000000000000000
    Size.PlatformDefault = False
    Stroke.Color = claAqua
    Stroke.Thickness = 4.000000000000000000
  end
  object Rectangle2: TRectangle
    Fill.Kind = None
    Size.Width = 601.000000000000000000
    Size.Height = 305.000000000000000000
    Size.PlatformDefault = False
    Stroke.Color = claHotpink
    Stroke.Thickness = 10.000000000000000000
  end
end

Nenhum comentário:

Postar um comentário

Observação: somente um membro deste blog pode postar um comentário.