Club Delphi  
    Paypal   FTP   CCD     Buscar   Trucos   Trabajo   Foros

Retroceder   Foros Club Delphi > Principal > OOP
Registrarse FAQ Miembros Calendario Guía de estilo Temas de Hoy

Coloboración Paypal con ClubDelphi

 
 
Herramientas Buscar en Tema Desplegado
  #6  
Antiguo 15-10-2008
JoseFco JoseFco is offline
Baneado
 
Registrado: dic 2007
Posts: 1.861
Poder: 0
JoseFco cantidad desconocida en este momento
Bueno asi esta el relajo... Digo el codigo para direccionar el StringGrid:




El codigo:

Código Delphi [-]
uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, Grids, StdCtrls, ExtCtrls;
type
  TForm1 = class(TForm)
    StringGrid1: TStringGrid;
    Label1: TLabel;
    Run: TButton;
    UpAddr: TButton;
    DownAddr: TButton;
    Timer1: TTimer;
    Button2: TButton;
    Button3: TButton;
    Memo1: TMemo;
    Edit1: TEdit;
    ValorCasilla: TLabel;
    Label2: TLabel;
    procedure InicializaGridBuffer;
    procedure FormCreate(Sender: TObject);
    procedure RunClick(Sender: TObject);
    procedure UpAddrClick(Sender: TObject);
    procedure DownAddrClick(Sender: TObject);
    procedure Button2Click(Sender: TObject);
    procedure Button3Click(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;
var
  Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.InicializaGridBuffer;
var
  i,j: integer;
begin
  StringGrid1.ColWidths[0] := 35;
  StringGrid1.Cells[0,0] := 'Addr';
  j := $0000;
  for i := 0 to 15 do
    if i = 0 then
      begin
        StringGrid1.Cells[i+1,0] := IntTohex(i,2);
        StringGrid1.Cells[0,i+1] := IntToHex(i,4);
      end
    else
      begin
        j := j + 16;
        StringGrid1.Cells[i+1,0] := IntTohex(i,2);
        StringGrid1.Cells[0,i+1] := IntToHex(j,4);
      end;
      end;
procedure TForm1.FormCreate(Sender: TObject);
begin
InicializaGridBuffer;
end;
procedure TForm1.RunClick(Sender: TObject);
var
 aCol, aRow : Integer;
 x,y : Integer;
 Cad : String;
 begin
 Cad := Label1.Caption;
 aRow := StrToInt('$'+Cad[3])+1;
 aCol := StrToInt('$'+Cad[4])+1;
 StringGrid1.Col := aCol;
 StringGrid1.Row := aRow;
 x := aRow;
 y := aCol;
  ValorCasilla.Caption:= StringGrid1.Cells[y,x];
end;
procedure TForm1.UpAddrClick(Sender: TObject);
begin
 Label1.Caption := inttohex(strtoint('$'+Label1.Caption)+1,4);
end;
procedure TForm1.DownAddrClick(Sender: TObject);
begin
  Label1.Caption := inttohex(strtoint('$'+Label1.Caption)-1,4);
end;
procedure TForm1.Button2Click(Sender: TObject);
begin
ShowMessage(StringGrid1.Cells[6, 6]);
end;
procedure TForm1.Button3Click(Sender: TObject);
var
  i,j: integer;
  hexa: string;
begin
 hexa := Edit1.text;
 for i := 1 to 15 do begin
      for j := 1 to 15 do begin
          if Pos(' ',hexa) = 0 then
           begin
           StringGrid1.Cells[j,i] := hexa;
             Exit;
             end
          else begin
                 StringGrid1.Cells[j,i] := Copy(hexa,1,2);
                 Delete(hexa,1,Pos(' ',hexa));
          end;
      end;
  end;
end;
end.

Algunas cositas agregadas para ademas de mover el cursor dentro del grid que me retorne el valor en esa casilla en particular.Ademas de un Timer, para poder jugar con el tiempo.(en esta etapa no es tan importante, pero cuando esto tome forma y autonomia.Sera de mucho valor.)

Un Saludo.

PD:Se aceptan criticas y sugerencias.La otra parte del proyecto la continuare en otro hilo.Para no salirme del tema de este.(no desvirtual)

Gracias Caro.

Última edición por JoseFco fecha: 16-10-2008 a las 00:37:36.
Responder Con Cita
 



Normas de Publicación
no Puedes crear nuevos temas
no Puedes responder a temas
no Puedes adjuntar archivos
no Puedes editar tus mensajes

El código vB está habilitado
Las caritas están habilitado
Código [IMG] está habilitado
Código HTML está deshabilitado
Saltar a Foro

Temas Similares
Tema Autor Foro Respuestas Último mensaje
2 conecciones a internet, como direccionar ? martita Redes 3 24-04-2008 23:02:36
Direccionar datos con Crystal Report Jose_Pérez Impresión 6 29-02-2008 14:17:08
Direccionar de página web a mi servidor con IP fija Héctor Randolph Internet 9 07-09-2006 06:13:18
direccionar una base de datos Elybb C++ Builder 7 10-08-2006 20:24:58
Direccionar a otra página lucasarts_18 PHP 5 26-08-2005 19:56:16


La franja horaria es GMT +2. Ahora son las 03:40:31.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
Traducción al castellano por el equipo de moderadores del Club Delphi
Copyright 1996-2007 Club Delphi