Montag, 3. April 2017

Lazarus databasegrid and multiselect with mouse click on the indicator column.

Normally lazarus allow multiple selection of rows only with [ctrl-key]+left-mouse-button.
If you want to allow user selecting multiple rows without holding [ctrl]-Key then do this:
1. Open lazarus/lcl/grids.pas
2. Edit MouseDown procedure and make this changes:


procedure TCustomDBGrid.MouseDown(Button: TMouseButton; Shift: TShiftState; X,
  Y: Integer);
var
  sonMouseInCol: integer; //ADD
//...

        P:=MouseToCell(Point(X,Y));
        sonMouseInCol:=P.X; //ADD
        if Gz=gzFixedRows then

//...
            if (Button=mbLeft) and((sonMouseInCol<>0)and(dgIndicator in Options)) then //CHANGE
              ClearSelection(true)
            else ToggleSelectedRow; //ADD
            if gz=gzFixedRows then
//..
            if (Button=mbLeft) and((sonMouseInCol<>0)and(dgIndicator in Options)) then //CHANGE
              ClearSelection(true)
            else ToggleSelectedRow; //ADD
            doMoveToColumn;
end; 


I indicated changes with red color other lines shows you where to make changes or add new code.

Now the user will be able to select multiple rows only with mouse click on the indicator column.
Of course you have to add dgMultiselect in TDBGrid.Options too.

Freitag, 17. März 2017

Lazarus and application bar from linux desktops.

If you don't like that child forms from Lazarus visible on the application bar is then do this.
1) If you use anchordocking then open components/anchordocking.pas  and make this change:
constructor TAnchorDockHostSite.CreateNew(AOwner: TComponent; Num: Integer);
begin
  //..
  DragKind:=dkDock;
  {$IfDef LINUX}
  ShowInTaskBar:=stNever; //Soner added
  {$IfEnd}  

  //...
end;

2) For not docked child forms open them and make same changes. I make here changes for ObjectInspector:


//  components/ideintf/objectinspector.pp

constructor TObjectInspectorDlg.Create(AnOwner: TComponent);
//..
  FComponentEditor := nil;
  {$IfDef LINUX}ShowInTaskBar:=stNever; {$IfEnd}//Soner
//..
end;

This is my xfce-panel entries before modification (Messages was docked to source-editor):


This is after modification:

Sorry for the very small pictures, i have very small panel size (18pixel).

Dienstag, 14. März 2017

Android phones and wifi acces points

Some android phones i.e. my f*cking HTC (I must buy everytime weird phones 😡) has problems with wifi access point if their name contains chararekters like '-üä' or space.
So if you have also problem to connect with your network then remove this characters from ssid.

Montag, 9. Januar 2017

Good Delphi/Lazarus Tips & Links

I'm using this post for good programming tips and links for Delphi and Lazarus.

Here is good tips for forms and form borders:
http://blog.delphi-jedi.net/2008/05/01/translucent-windows-with-aero/

Delphi 7 touch and gesture message handling
http://www.tecepe.com.br/d7gestures/