Re: [lazarus] Several LFM patches

2005-10-05 Thread Darius Blaszijk
On Tue, 2005-10-04 at 23:55, Mattias Gaertner wrote:
  - improved indenting
 
 Beware. There are only a very few indenting styles that most people find
 easier to read.
I believe everybody has it's own preferences definitely. Therefore
improved is not well chosen I admit.

 It's nice, that you want to make the code more 'readable'. But IMO it's
 better to add comments and rename identifiers, than to apply your personal
 style to the code. 
I believe that both indenting and commenting serve a purpose in
improving readability, and yes indenting is subject to arbitrary
choices. Still I believe that formalizing the indentation would be
benificial for all.
For my own purpose I use Jedi Code Format. This tool is very stable and
very customizable. It performs indentation / capitalization / cleanup
automatically and each aspect of the process can be controlled.

Darius

_
 To unsubscribe: mail [EMAIL PROTECTED] with
unsubscribe as the Subject
   archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] Re: TDbf and onFilterRecord

2005-10-05 Thread Felipe Monteiro de Carvalho

Cristiano Magro wrote:

I start to use TDbf, and I try use MyDB.onFilterRecord,
but never run.

I need to filter record that field are empty, and MyDB.Filter not work
how I want.


Can you post an example of the code you are trying to run?

Felipe

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives


[lazarus] Re: Dinamic gtk?

2005-10-05 Thread Felipe Monteiro de Carvalho

Eduardo wrote:
Can be used Lazarus make a dinamic GUI using gtk for? I want to 
read the configuration file and change my app GUI. I don't want a skin 
style, just put buttons, checkboxs, edit fileds, etc.. depending the 
conf file.


That is quite easy. You just have to create the components by hand. Just 
create the components on the OnCreate event of your form:


procudure TMyForm.OnCreate(Sender: TObject);
begin
  // Here read from the configuration file

  Panel := TPanel.Create(Self);
  Panel.Parent := Self;
  // Set the position for the Panel (or any other component)
  Panel.Left := ConfigFileLeft;
  Panel.Top := ConfigFileTop;
  Panel.Width := ConfigFileWidth;
  Panel.Height := ConfigFileHeight;

  // Do the same for other controls
end;

and on the OnDestroy free them:

procudure TMyForm.OnDestroy(Sender: TObject);
begin
  Panel.Free;
end;

Declare the component namas as variables on your TMyForm.

You may want to create the configuration file on xml, but you need to 
learn how to use XML DOM if you do so, for sure this is the more elegant 
way.


Also take notice that it is not necessary to use gtk call directly for 
this, so this is a multi-platform approach. In fact you don't need to 
draw the form to have one on Lazarus. You can simple have the entire 
form create by hand just by calling the correct methods and setting the 
correct properties, but on most cases it is easier to draw the form.


Another approach is to create the components with the form designer but 
set their Visible property to False and then set it to True when you want.


If you want an unknown number of components to be created you may create 
a dinamyc array of components, maybe this works.


Felipe

_
To unsubscribe: mail [EMAIL PROTECTED] with
   unsubscribe as the Subject
  archives at http://www.lazarus.freepascal.org/mailarchives