Club Delphi  
    FTP   CCD     Buscar   Trucos   Trabajo   Foros

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

Grupo de Teaming del ClubDelphi

Respuesta
 
Herramientas Buscar en Tema Desplegado
  #1  
Antiguo 15-11-2006
Avatar de Behemot
Behemot Behemot is offline
Miembro
 
Registrado: oct 2005
Posts: 15
Poder: 0
Behemot Va por buen camino
Ya logre hacer funcionar parte de lo que quiero lo hice con el TEdit pero me faltan el número de lineas y el color de la letra. Tratare de hacerlo con el TRichEdit. Lo otro es que lo hice controlando el objeto pero lo que necesito es heredar del objeto o mejor crear un componente pero no se como hacerlo.
Responder Con Cita
  #2  
Antiguo 15-11-2006
Avatar de Behemot
Behemot Behemot is offline
Miembro
 
Registrado: oct 2005
Posts: 15
Poder: 0
Behemot Va por buen camino
Aqui les mando el codigo:
///////////////////////////////////////////////////////////////
Código Delphi [-]
 
procedure TForm1.ControlMouseMoveEdit(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
var
iCaracteres, iLineaPos, iCaracterPos : Integer;
begin
  // ControlMouseMoveEdit() se activa en : OnMouseMove
  iCaracteres := (Sender as TEdit).Tag;
  iLineaPos := SendMessage((Sender as TEdit).Handle,EM_LINEFROMCHAR,(Sender as TEdit).SelStart,0);
  iCaracterPos := SendMessage((Sender as TEdit).Handle,EM_LINEINDEX,iLineaPos,0);
  iCaracterPos := (Sender as TEdit).SelStart-iCaracterPos;
  if iCaracterPos < iCaracteres then begin
    (Sender as TEdit).SelStart := iCaracteres;
  end;
end;
//////////////////////////////////////////////

//////////////////////////////////////////////
Código Delphi [-]
 
procedure TForm1.ControlEdit(Sender: TObject; var Key: Word;
  Shift: TShiftState);
var
iCaracteres, Lpos, Cpos : Integer;
begin
    // ControlEdit() se activa en : OnKeyDown y OnKeyUp del Edit
    iCaracteres := (Sender as TEdit).Tag;
    Lpos := SendMessage((Sender as TEdit).Handle,EM_LINEFROMCHAR,(Sender as TEdit).SelStart,0);
    Cpos := SendMessage((Sender as TEdit).Handle,EM_LINEINDEX,Lpos,0);
    CPos := (Sender as TEdit).SelStart-CPos;
    Label2.Caption:=IntToStr(Cpos);  //Columna
    if (key = VK_BACK) or (key = VK_DELETE) then begin
      if Cpos < iCaracteres then begin
        (Sender as TEdit).Undo;
        (Sender as TEdit).SelStart := iCaracteres;
      end;
    end;
    if (key = VK_HOME) then begin
      (Sender as TEdit).SelStart := (Sender as TEdit).Tag;
    end;
    if (key = VK_LEFT) or (key = VK_UP) then begin
      if Cpos < iCaracteres then
       (Sender as TEdit).SelStart := iCaracteres;
    end;
    if(Key >= 30) and (Key <= 122) and (Key <> 35) and (Key <> 36) and not ((Key >= 37) and (Key <= 40)) then begin
      if( Length((Sender as TEdit).Text) = (Sender as TEdit).MaxLength) then
            SelectNext(Sender as TWincontrol, true, true);
    end;
    if (key = VK_DOWN) then begin
      SelectNext(Sender as TWincontrol, true, true);
    end;
end;
/////////////////////////////////////////////

/////////////////////////////////////////////
Código Delphi [-]
 
procedure TForm1.ControlMouseMoveEdit(Sender: TObject; Shift: TShiftState; X,
  Y: Integer);
var
iCaracteres, iLineaPos, iCaracterPos : Integer;
begin
  // ControlMouseMoveEdit() se activa en : OnMouseMove
  iCaracteres := (Sender as TEdit).Tag;
  iLineaPos := SendMessage((Sender as TEdit).Handle,EM_LINEFROMCHAR,(Sender as TEdit).SelStart,0);
  iCaracterPos := SendMessage((Sender as TEdit).Handle,EM_LINEINDEX,iLineaPos,0);
  iCaracterPos := (Sender as TEdit).SelStart-iCaracterPos;
  if iCaracterPos < iCaracteres then begin
    (Sender as TEdit).SelStart := iCaracteres;
  end;
end;
////////////////////////////////////////////
Responder Con Cita
  #3  
Antiguo 15-11-2006
Avatar de Behemot
Behemot Behemot is offline
Miembro
 
Registrado: oct 2005
Posts: 15
Poder: 0
Behemot Va por buen camino
Cita:
¿70 capturas qué significa? ¿70 componentes? No lo entiendo.
Si la idea es utilizar el TRichEdit en vez del TEdit en el proceso de captura de datos, pero la pregunta es si la memoria se carga mucho con este componente o se maneja igual al TEdit.
Responder Con Cita
Respuesta



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
Saber si un archivo ha sido modificado desde fuera ixMike Varios 7 11-09-2006 19:13:14
Último fichero modificado ? spab API de Windows 3 30-11-2005 03:36:33
Urgente blob modificado soloriv Gráficos 1 14-07-2005 15:51:05
Pasar el valor de un TEdit dentro de un StringGrid a otro TEdit que está fuera atirado Varios 4 11-09-2004 19:13:48
Registro modificado ander Firebird e Interbase 2 28-05-2003 08:16:19


La franja horaria es GMT +2. Ahora son las 18:38:59.


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