Jump to content
Fórum Script Brasil
  • 0

Tempo De Execução


Guest --ROBINHOCNE --
 Share

Question

Guest --ROBINHOCNE --

Pessoal estou desenvolvendo um form para eu marcar uns agendamentos fiz os seguinte parametros nos codigos para essa tabela ser em tempo de execução mas eu não sei o porque esta aparecendo, alguém verifica os meu codigos e vê o que eu fiz de errado.

unit Praticas;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls, psvBasiclbl, psvBorderLabel, Buttons, WinSkinData,
  Grids, DBGrids, ExtCtrls;

type
  Tfrmpraticas = class(TForm)
    txtcod: TEdit;
    txtaluno: TEdit;
    txtcodins: TEdit;
    txtnomins: TEdit;
    txtcodcat: TEdit;
    txtcat: TEdit;
    spbaluloc: TSpeedButton;
    psvBorderLabel1: TpsvBorderLabel;
    psvBorderLabel2: TpsvBorderLabel;
    psvBorderLabel3: TpsvBorderLabel;
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    Panel1: TPanel;
    spbfec: TSpeedButton;
    spbpro: TSpeedButton;
    spbant: TSpeedButton;
    sbxPra: TScrollBox;
    Panel2: TPanel;
    panHor: TPanel;
    Panel3: TPanel;
    Panel4: TPanel;
    Panel5: TPanel;
    Panel6: TPanel;
    panSeg: TPanel;
    panTer: TPanel;
    panQua: TPanel;
    panQui: TPanel;
    panSex: TPanel;
    panSab: TPanel;
    panDom: TPanel;
    Panel14: TPanel;
    Panel15: TPanel;
    Panel16: TPanel;
    Panel17: TPanel;
    Panel18: TPanel;
    Panel19: TPanel;
    Panel20: TPanel;
    Panel21: TPanel;
    Panel7: TPanel;
    procedure spbfecClick(Sender: TObject);
    procedure FormShow(Sender: TObject);

  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmpraticas: Tfrmpraticas;

implementation

{$R *.dfm}

uses funcoes, fprincipal, fdtmiza;




procedure Tfrmpraticas.spbfecClick(Sender: TObject);
begin
close;
end;


procedure Tfrmpraticas.FormShow(Sender: TObject);
var labels : TLabel; edits  : TEdit;
    a, top_edit, top_label, left_edit : Integer;
    HoraAtual, HoraFinal : TTime;
begin
   top_edit    := 8;
   top_label   := 10;
   left_edit   := 90;

   HoraFinal   := StrToTime( '21:40:00' );
   HoraAtual   := StrToTime( '08:00:00' );

   while ( ( HoraAtual + 50 ) < HoraFinal ) do
      begin
         // cria a label do horario
         labels := TLabel.Create( Self );
         with labels do
            begin
               Parent  := sbxPra;
               Top     := top_label;
               Left    := 16;
               Caption := FormatDateTime( 'hh:nn', HoraAtual );
               Name    := 'lbl_' + FormatDateTime( 'hhnn', HoraAtual );
               with Font do
                  begin
                     Name  := 'Arial';
                     Size  := 12;
                     Style := [fsBold];
                  end;
            end;

         for a := 1 to 7 do
            begin
               // cria o edit do codigo do aluno
               edits := TEdit.Create( Self );
               with edits do
                  begin
                     Parent    := sbxPra;
                     Top       := top_edit;
                     Left      := left_edit;
                     Name      := 'ed_' + IntToStr( a ) + FormatDateTime( 'hhnn', HoraAtual );
                     Width     := 71;
                     Enabled   := False;
                  end;

               // cria o edit da categoria
               left_edit := left_edit + 70;
               edits := TEdit.Create( Self );
               with edits do
                  begin
                     Parent    := sbxPra;
                     Top       := top_edit;
                     Left      := left_edit;
                     Name      := 'ed_cat_' + IntToStr( a ) + FormatDateTime( 'hhnn', HoraAtual );
                     Width     := 25;
                     Enabled   := False;
                  end;

               left_edit := left_edit + 30;
            end;

         top_label := top_label + 32;
         top_edit  := top_edit + 32;
         left_edit := 90;

         if ( HoraAtual < StrToTime( '18:00:00' ) ) then
            HoraAtual := HoraAtual + 3600
         else
            HoraAtual := HoraAtual + 3000;
      end;
end;

end.

Edited by Micheus
Incluída tag's CODE para melhorar a visualização do quadro final
Link to comment
Share on other sites

1 answer to this question

Recommended Posts

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

  • Forum Statistics

    • Total Topics
      149.8k
    • Total Posts
      646.7k
×
×
  • Create New...