Recent

Recent Posts

Pages: [1] 2 3 ... 10
1
Spanish / Re: Duda sobre listas.
« Last post by BlueIcaro on Today at 12:02:48 pm »
El problema que me encuentro ahora, necesito hacer una lista que contenga dos tipos Items.
¿Hay alguna clase que me sirva para eso?.
¿Te refieres a:?
1. 2 tipos de ítems en un solo ítem.
2. Ítems de 2 tipos diferentes.

Para el caso 1, no veo complicación, solo que ahora tu TMiItem deberá incluir dos campos de tipo Ítem.
Aunque yo lo haría con listas genéricas, crrando una clase que contenga los campos/objetos que quiera.
para el caso 2, podrías hacer uso del polimorfismo y crear una clase base y dos clases derivadas.
Hola, lo que quiero hacer es una lista, tengas items, pero no de una clase determinada, sino de dos.
Por ejemplo. Crear una lista que contenga de un centro de estudio o escuela. Así tendría una lista con dos tipos de item. Uno sería del tipo Alumno, y otro sería otro diferente, que sería sería del tipo Profesor.
Creo que la opción de generics es buena. Estoy mirando ejemplos.
Saludos
2
General / Re: RichMemo Bold/Italic Mechanism Q
« Last post by pixelink on Today at 11:57:57 am »
Just to re-post...
I already found a solution that works....

This takes into consideration if text is Bold or italic or both.
It doesn't remove it if it is so.

BOLD BUTTON CODE

Code: Pascal  [Select]
  1.  
  2.  
  3. procedure TForm5.btnBoldClick(Sender: TObject);
  4. var
  5.  fp   :  TFontParams;
  6. begin
  7.  Caption := Format('sel start %d,  sel length %d', [txtRTF.SelStart, txtRTF.SelLength]);
  8.  txtRTF.GetTextAttributes(txtRTF.SelStart, fp);
  9.  
  10.    if (fsBold in fp.Style) then
  11.       txtRTF.SetRangeParams (txtRTF.SelStart, txtRTF.SelLength,[tmm_Styles, tmm_Color],
  12.       ''{font},0{fontsize},clBlack{color},[]{make bold/italic},[fsBold]{remove bold/italic})
  13.    else
  14.       txtRTF.SetRangeParams (txtRTF.SelStart, txtRTF.SelLength,[tmm_Styles, tmm_Color],
  15.       ''{font},0{fontsize},clBlack{color},[fsBold]{make bold/italic},[]{remove bold/italic});
  16.  
  17. end;
  18.  
  19.  


ITALIC BUTTON

Code: Pascal  [Select]
  1.  
  2.  
  3. procedure TForm5.btnBoldClick(Sender: TObject);
  4. var
  5.  fp   :  TFontParams;
  6. begin
  7.  Caption := Format('sel start %d,  sel length %d', [txtRTF.SelStart, txtRTF.SelLength]);
  8.  txtRTF.GetTextAttributes(txtRTF.SelStart, fp);
  9.  
  10.    if (fsBold in fp.Style) then
  11.       txtRTF.SetRangeParams (txtRTF.SelStart, txtRTF.SelLength,[tmm_Styles, tmm_Color],
  12.       ''{font},0{fontsize},clBlack{color},[]{make bold/italic},[fsItalic]{remove bold/italic})
  13.    else
  14.       txtRTF.SetRangeParams (txtRTF.SelStart, txtRTF.SelLength,[tmm_Styles, tmm_Color],
  15.       ''{font},0{fontsize},clBlack{color},[fsItalic]{make bold/italic},[]{remove bold/italic});
  16.  
  17. end;
  18.  
  19.  
3
Have you ever wondered why the default code page in Delphi is the system code page. The answer is simple: legacy code.
4
I dont get it. You have a DBGrid, a DBCombobox, a few DBEdit and t Memo on form. Each line in dbgrid is showed in these components. So why want you to click on a cell. The option you have set in DBGrid is dgRowselect. It meens you can't edit a cell.
Quote
MY ONLY QUESTION FOR NOW IS. After displaying another window(Form), edit the RTF in RichMemo...
How do I get it back to the cell where I clicked the "Button" in the cell???
The cursor on DBGrid didn't moved when you calling a new form.

I don't undersand what you mean.
How did you call the selected recod in the new form?

You must not of read the thread very well...

the reason I was using the DB controls is because the DB components were not working.

I have since fixed those.
I am not using DB Controls except one I need to store RTf code. Because LAZ doesn't to my knowledge have a DB RichEdit Control that can be hooked up to the SQL components.
SO, I am using a DB Memo as a go between storing the RTF data in Db and using RichMemo to edit the RTF.
I use code to transfer the RTF from DB Grid to DBMemo then onto RichMemo.

So, I have it setup so the user edits the grid directly.

Things have changed, go back and re-read the entire thread,.
5
Android / Re: Android + Mysql...
« Last post by dioaffriza on Today at 11:38:13 am »
6
Debugger / Re: Problems with Debugger on OSX
« Last post by Martin_fr on Today at 11:16:56 am »
The dylib info was only for if you were interested. Its of no difference to me.

The watches would be down to whatever caused that error.
Btw, the text of the error, is it "The debugger encountered some errors/warnings while launching the target application"?
Because "Unable to load Dwarf Debug Info", I am not aware of.

The error dlg, does it have a "more" button? What info does it provide?
7
Packages and Libraries / Re: FPExif duplicates value for DTOrig
« Last post by Romain on Today at 10:38:49 am »
Sorry, forget to mention : NirSoft ExifDataView

http://www.nirsoft.net/utils/exif_data_view.html

Romain
8
Packages and Libraries / Re: FPExif duplicates value for DTOrig
« Last post by wp on Today at 10:32:30 am »
Which program are you using to display the exif fields in the screenshot?
9
Packages and Libraries / FPExif duplicates value for DTOrig
« Last post by Romain on Today at 10:24:39 am »
Hi,

I use FPExif library [r6842] with Lazarus 2.0.2

Whenever I try to modify the DTOrig EXIF value, the value gets changed but appended twice.

For example, if I want to set the value to 2019:04:26 10:16:16, it gets written as string 2019:04:26 10:16:162019:04:26 10:16:16 ( see screenshot below )

Here is an extract of the code I use :

Code: Pascal  [Select]
  1.  L_ImageInfo := TImgInfo.Create;
  2.  
  3.   try
  4.     L_ImageInfo.LoadFromFile(F_FullName);
  5.     if L_ImageInfo.ExifData <> nil then
  6.     begin
  7.  
  8.       L_Tag := L_ImageInfo.ExifData.TagByName['DateTimeOriginal'];
  9.       if L_Tag <> nil then
  10.         TDateTimeTag(L_Tag).AsDateTime := F_NewPhotoDT;
  11.  
  12.       L_Tag := L_ImageInfo.ExifData.TagByName['DateTimeDigitized'];
  13.       if L_Tag <> nil then
  14.         TDateTimeTag(L_Tag).AsDateTime := F_NewPhotoDT;
  15.  
  16.       L_Tag := L_ImageInfo.ExifData.TagByName['DateTime'];
  17.       if L_Tag <> nil then
  18.         TDateTimeTag(L_Tag).AsDateTime := F_NewPhotoDT;
  19.  
  20.       try
  21.         L_ImageInfo.SaveToFile(F_FullName);
  22.  
  23.       except
  24.          ....
  25.       end;
  26.  
  27.  

Best regards,
Romain
10
I dont get it. You have a DBGrid, a DBCombobox, a few DBEdit and t Memo on form. Each line in dbgrid is showed in these components. So why want you to click on a cell. The option you have set in DBGrid is dgRowselect. It meens you can't edit a cell.
Quote
MY ONLY QUESTION FOR NOW IS. After displaying another window(Form), edit the RTF in RichMemo...
How do I get it back to the cell where I clicked the "Button" in the cell???
The cursor on DBGrid didn't moved when you calling a new form.

I don't undersand what you mean.
How did you call the selected recod in the new form?
Pages: [1] 2 3 ... 10