Re: [Lazarus] Strange behavior of AutoSizeColumn in StringGrid

2015-05-06 Thread Valdas Jankūnas

2015.05.06 01:52, Jesus Reyes rašė:



Well, apparently it could be a bug with a side effect :).

It seems the Multiline property is a Column's Title property not a column 
property
however it is treated as if it is a column property, something that should only 
affect
the title cell but it actually affects the whole column. That's the side effect.

If that is the intended behaviour (Multiline title property is a contribution, 
Werner?)
then it's OK to me, in that case please try the attached patch and write back 
your results,
here I tested under Windows and it seems to work fine.

Jesus Reyes A.



tested on Linux: AutosizeColumn[s] stops working. But if I add line 
aRect := Rect(0, 0, High(integer), High(integer)); before 
DrawText... then it works, also bug is gone.


--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Strange behavior of AutoSizeColumn in StringGrid

2015-05-05 Thread Valdas Jankūnas

Hello,

situation: GridColumn.Multiline is TRUE and one of StringGrid's cell has 
multiline text. If I perform StringGrid.AutosizeColumn[s] then column 
width become like all text of cell was in single line (attached test 
project: try to press button several times).


 Is this a Bug?


--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Triming spaces in IDE

2015-05-04 Thread Valdas Jankūnas

2015.05.03 22:58, Martin Frb rašė:

On 03/05/2015 19:57, Valdas Jankūnas wrote:

Hello,

I know that Lazarus editor has option to trim trailing spaces while
editing.
 Has editor any option to trim trailing spaces before saving in to
file (like a Kate the text editor from KDE)?


No it has not.

Also trimming spaces, only trims those spaces that are entered during
the session (or more detailed that are on a line edited during the session)
Spaces that are loaded into the editor are not trimmed, if the line on
which they are is not edited.  This is by design.

So there is room for features such as:
- trim on load
- trim on save

You can add a feature request, but there is a long list at current...


Thanks. Reported #0028023

--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Triming spaces in IDE

2015-05-03 Thread Valdas Jankūnas

Hello,

I know that Lazarus editor has option to trim trailing spaces while editing.
 Has editor any option to trim trailing spaces before saving in to file 
(like a Kate the text editor from KDE)?


--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Strange Alphasort in ListView

2015-04-15 Thread Valdas Jankūnas

2015.04.14 17:49, Vojtěch Čihák rašė:

Delphi has no properties AutoSort, SortColumn and SortDirection nor
methods BeginUpdate and EndUpdate.

I would provide a patch which will set Flag lffPreparingSorting on
BeginUpdate and reset it on EndUpdate.
+one additional call of Sort on EndUpdate (maybe only if AutoSort is
True) OR move Sort; form protected to public.

What is preferred?

V.


Solution to move Sort to public is more convenient for me if it not 
will break something (or will break?).



--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Strange Alphasort in ListView

2015-04-14 Thread Valdas Jankūnas

Hello,

when I execute ListView.AlphaSort then ListView always sorts first 
column with default sort order. Also it resets SortColumn property to 
zero and SortOrder to default (see attached screenshot: before and after 
execution of Alphasort).


 Why it not sorts current SortColumn with current SortOrder? Is this a Bug?

 Tried in Qt, Gtk2 and Win widgetsets - same strange result.


--
  Valdas Jankūnas
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Strange Alphasort in ListView

2015-04-14 Thread Valdas Jankūnas

2015.04.14 16:22, Vojtěch Čihák rašė:

I understand. Method Sort; is protected (as it is in Delphi).

You have probably no other choice than do

  ListView1.SortDirection:=sdDescending;
  ListView1.SortDirection:=sdAscending;

which works but it is unefficient, sorting is done twice.

I tried:
  ListView1.BeginUpdate;
  ListView1.SortDirection:=sdDescending;
  ListView1.EndUpdate;
  ListView1.SortDirection:=sdAscending;but it doesn't help, sorting is
still done twice (at least on Qt).ListView has some flags to avoid
sorting but those flags are private.V.



Thanks for mentioning protected Sort procedure. So I come to dirty 
solution:


 - create helper class:

type
  THack = class(TListView)
  public
 procedure Trigger_sort;
  end;

 - implement Trigger_sort:

procedure THack.Trigger_sort;
begin
Sort;
end;

 - now when to trigger sort with current settings is needed then execute:

THack(ListView1).Trigger_sort;


 Works for me (at least in Qt (Linux) and Win (Windows7)).



--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Strange Alphasort in ListView

2015-04-14 Thread Valdas Jankūnas

2015.04.14 15:34, Vojtěch Čihák rašė:

No, it isn't a bug.

In sources, you can see comment:

function AlphaSort: Boolean; // always sorts column 0 in sdAscending order


Looked not in *primary* source (Google, Documentation) :)



So if you want other sorting, you must set three sort-related properties:

ListView1.SortColumn:=1;
ListView1.SortDirection:=sdAscending;
ListView1.SortType:=stText;

It works, I just tested in Qt.


Why I came to AlphaSort: in my source ListView is cleared (columns stays 
same) and populated with new info. After that current column (say 
SortColumn=1) is no sorted (Autosort is TRUE; tried in Qt, Gtk2 and Win) 
so I must somehow to trigger sorting. But how?



--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] HC-06 and Lazarus

2015-04-06 Thread Valdas Jankūnas

Hello,

I'm planning to create a application which will communicate with  device 
through HC-06. HC-06 (slave) is serial port through bluetooth.


 I found Lazarus package bluetoothlaz-0.2. Can I use this library to 
open serial port trough bluetooth and do some serial transfers?
 Is development of this library active? Will be there support for 
Windows platform?


P.S. Sorry for my bad English.

--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Cannot debug

2015-03-16 Thread Valdas Jankūnas

2015.03.16 23:37, Martin Frb rašė:

Or open the breakpoint dialog (menu view  debug windows). MAybe you


This helped. There I found that one breakpoint is in file that is long 
gone from project, so I deleted that breakpoint and now I able to debug.


Thank you!


--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Cannot debug

2015-03-16 Thread Valdas Jankūnas

Hello,

 when I try to debug my code with some breakpoints in IDE (by hitting 
F9) then I always get message from Lazarus:


The debugger was unable to set all breakpoints during initialization. 
You may with to check if all sources were compiled with debug-info. 
Press OK to ignore this and continue


 How to fix this to be able to debug?


Current settings:

Project options - Debugging - Generate debug info for GDB = checked;
Project options - Compilation and Linking - Optimization level = 1 
(also tried 0);

IDE options - Debuger - Type and file = GNU debuger, gdb;
External DBG file is generated;

Lazarus 1.5 r48395M FPC 2.6.4 x86_64-linux-qt

--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Hint of TAChart

2015-03-03 Thread Valdas Jankūnas
2015-03-01 19:24 GMT+02:00 Werner Pamler werner.pam...@freenet.de:

 You are probably working with DistanceMode=cdmOnlyX of the
 DataPointHintTool; with cdmOnlyY the hint would appear if the mouse is at
 the left or right outside the series region.

...

 think the other datapoint tools do not need it). With MouseInsideOnly
 set to true the hint does not appear if the mouse is outside the plotting
 frame.



MouseInsideOnly helped. Thank you.

__
 Valdas Jankūnas
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Hint of TAChart

2015-03-01 Thread Valdas Jankūnas

Hello,

 in TChart I use TDataPointHintTool. I discovered (see attached 
screeshot) that Hint is triggered also in outside of frame (frame - 
area where series is plotted). This happens at upper and bottom but not 
at left and right sides of frame.


 Is this OK or bug?

 Sorry for my bad English.

--
  Valdas Jankūnas
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] CodeToolManager: file was not reached by scanner

2015-02-27 Thread Valdas Jankūnas

...

unit, so I moved that unit usage in interface section - that helped. And
then again, restored it in to implementation section - no problems. Strange.


Can you reproduce the problem when moving the uses back to
implementation?



 Yes I did that - no problems. Sadly, when problem was there I do not 
make a snapshot of .lazarus dir  for deeper investigation.


 If problem will arise again then I'll try to localize source of it.

--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] CodeToolManager: file was not reached by scanner

2015-02-27 Thread Valdas Jankūnas

Hello,

 I managed to fix that problem but in unexplainable manner:

2015.02.27 18:03, Mattias Gaertner rašė:

It means codetools parsed the unit, but the parser didn't come to the
position, where the cursor is. For example if there is an end. in
front. Search for the end.
You can find out in Code Explorer what the parser found.


I checked all end., it appears only in .pas files, only once in 
every file.




Another possibility is that irankiai.pas is/was an include file.
Open irankiai.pas, then IDE menu / Source / View Unit information /
clear include cache.


 Unit Information shows that unit irankiai.pas is included by main 
unit pagrindinis.pas. If I press Goto Include Directive then cursor 
jumps at line unit pagrindinis; in main unit and message window shows 
same error.
 I tried to clear include cache - it help little: I can Ctrl+Up,Down in 
irankiai.pas. But if I in another unit do Ctrl+LeftMause on function 
name which is implemented in unit irankiai.pas  then problem arises.
 Unit irankai is in Uses clause in implementation section in main 
unit, so I moved that unit usage in interface section - that helped. And 
then again, restored it in to implementation section - no problems. Strange.



--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] CodeToolManager: file was not reached by scanner

2015-02-26 Thread Valdas Jankūnas

Hello,

 today I bumped on to problem:

- in Lazarus IDE I opened unit file irankiai.pas which is listed in 
Project Inspector;

- placed cursor in body of one functions;
- tried to view declaration of that function - Shift+Ctrl+Up

 after that cursor jumped in to main unit at end. line, Message 
Window complains that Codetools, Errors: 1 and pagrindinis.pas(175,1) 
Error: cursor pos outside of code, console reports (IDE compiled with 
CTDEBUG):


### TCodeToolManager.HandleException: file was not reached by scanner 
at Line=983 Col=36 in 
/home/senbuvis/Mano_popieriai/Programavimas/Lazarus/Programos/Pantografo_modeliavimas/Programa/Moduliai/irankiai.pas
### TCodeToolManager.HandleException: cursor pos outside of code at 
Line=179 Col=4 in 
/home/senbuvis/Mano_popieriai/Programavimas/Lazarus/Programos/Pantografo_modeliavimas/Programa/Moduliai/pagrindinis.pas


 This happen only inside that irankiai.pas unit.

 I don't understand why this happens and how to fix this problem. Some 
advice?



Sorry for my bad english.

--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Can't enter negative values in to TFloatSpinEdit

2013-11-12 Thread Valdas Jankūnas

Helo,

situation:
- os: Linux Kubuntu 13.10;
- Lazarus: Lazarus 1.3 r43416M FPC 2.6.2 x86_64-linux-qt;
- locale: LANG=lt_LT.UTF-8, LANGUAGE=lt, LC_*=lt_LT.UTF-8, LC_ALL=
- Form's WS: qt;
- on Form is placed TFloatSpinEdit (Max:100, Min:-100).

 When program is running I can't enter negative values:
- select all, pres minus sign button (hex: 2D) - minus appears, press 
any digit - no reaction;

- select all, press any digit - digits appears;
- select all, paste (Right click - Paste) -4 prom text editor - 
nothing changes;

- select all, paste 3 from editor - text accepted.

 Why? Is it known problem?

--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Centered elements in autosize enabled panel. Possible?

2013-11-11 Thread Valdas Jankūnas

2013.11.11 06:06, Avishai rašė:

Could you use a TPanel in place of the TBevel?  I tried that and it  gives
the same visual effect without the size problems.  But I don't know what
you are doing with the TBevel.


Hello,

 I use TBevel as separator (Shape=bsLeftLine) between components. I 
tried TPanel: looks good, also its Width  automatically adjusts to 2 
when CellAlighHorizontal is set to other than ccaFill.


 Also I found how to rearrange Childs easily when ChildSizing is used:
- Parent.ChildSizing set to cclNone;
- change Z order of Child;
- revert back Parent.ChildSizing.

 I found why TBevel doesn't want shrink less than 50px: TBevel has 
function GetControlClassDefaultSize where Result.CY := 50; is hardcoded.


--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Centered elements in autosize enabled panel. Possible?

2013-11-10 Thread Valdas Jankūnas

2013.11.10 18:24, William Oliveira Ferreira rašė:

I think you could also use anchors


Anchors not helps if Parent.Autosize is True.

I found better solution:
- Panel.AutoSize := True;
- Panel.ChildSizing.ControlsPerLine := MaxInt;
- Panel.ChildSizing.Layout := cclLeftToRightThenTopToBottom;
- Every Child.BorderSpacing.Left := 2;
- Every Child.BorderSpacing.CellAlignVertical := ccaCenter;
- Every Child.AutoSize := True;


If you want to adjust Child's Width (by default you cannot) then you 
must use overridden procedure CalculatePreferredSize in class of that 
Child, in which:


   inherited CalculatePreferredSize(PreferredWidth, PreferredHeight, 
WithThemeSpace);

   PreferredWidth := Width;


--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Centered elements in autosize enabled panel. Possible?

2013-11-10 Thread Valdas Jankūnas

2013.11.10 23:03, Avishai rašė:

You can also use Constraints to set height/width of children with
ChildSizing.


 Forgot about that, thanks.

 One problem left: when you add TBevel as child and if you want it 
BorderSpacing.CellAlignVertical=ccaFill (to make separator), you get 
fixed height (always 50). To fix this I must use custom TBevel with 
overridden CalculatePreferredSize with PreferredHeight := 1; in it.


 Is there more elegant way?

--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Centered elements in autosize enabled panel. Possible?

2013-11-09 Thread Valdas Jankūnas

Hello,

I want to create this layout:
- form has a Panel;
- Autosize of Panel is True;
- Panel has Controls with various heights;
- every Control in Panel must be centered vertically.

I tried this (trough Anchor editor):
- Control2 centered to Control1;
- Control1 centered to Panel.
But then Panel shrinks to Height=2 (circular align happens?).

Is it possible to create mentioned layout (preferably not through code)?


Sorry for bad English.

--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Centered elements in autosize enabled panel. Possible?

2013-11-09 Thread Valdas Jankūnas

2013.11.09 22:52, Avishai rašė:

OK.  I tried putting 2 Labels Align:= alLeft.  For both Labels I set
BorderSpacing Left and Right := 10 and Layout := tlCenter.  Then I set
Panel.AutoSize := True.  It looks like it does what you want.


It works! Even with autosized Buttons or Edits.

Thanks!


--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


[Lazarus] Font.OnChange already occupied

2012-11-21 Thread Valdas Jankūnas

Hello,

 I discovered that Font.OnChange of Form and their Components after 
creation is already assigned (not nil). Is it Ok?


--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Font.OnChange already occupied

2012-11-21 Thread Valdas Jankūnas

2012.11.21 14:46, Mattias Gaertner rašė:

On Wed, 21 Nov 2012 14:33:13 +0200
Valdas Jankūnas zmu...@gmail.com wrote:


Hello,

   I discovered that Font.OnChange of Form and their Components after
creation is already assigned (not nil). Is it Ok?


Yes.



So, if I use own Font.OnChange event handler, then correct way is: to 
call inherited event handler (saved before assignment) before font 
modification (of child components) in own event handler or after?



--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Call for translations updates for 1.0 release and pending Portuguese translation removal

2012-08-12 Thread Valdas Jankūnas

2012.08.03 01:08, Maxim Ganetsky rašė:

Hello.

Now that Lazarus 1.0 RC1 is out it is time to review and update
translations for it.

Please check out fixes branch
(http://svn.freepascal.org/svn/lazarus/branches/fixes_1_0 ), review and
update your translations and attach updates (as full PO files, not
patches) to our bugtracker. Mark your reports with Lazarus version
clearly in order to avoid confusion.


Is there differences (in i18n files) between branches/fixes_1_0 and 
trunk? After svn up both says Updated to revision 38228...


If so, is there automated way to transfer (replace in target) translated 
strings from one to another tree of files? I'm asking because I have 
translations updates for trunk.


If no, can I send translations from trunk as translations for 
branches/fixes_1_0? Or they automatically trunk - 
branches/fixes_1_0 in server?


--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Call for translations updates for 1.0 release and pending Portuguese translation removal

2012-08-12 Thread Valdas Jankūnas

2012.08.12 23:41, Maxim Ganetsky rašė:

12.08.2012 23:34, Valdas Jankūnas пишет:

Is there differences (in i18n files) between branches/fixes_1_0 and
trunk? After svn up both says Updated to revision 38228...


Yes, there are. They are not that global, though. You can use diff tool
to see them.


If so, is there automated way to transfer (replace in target) translated
strings from one to another tree of files? I'm asking because I have
translations updates for trunk.


Just replace your .po files, then recompile Lazarus clean (you should
have installed in Lazarus all packages for which you update translations
and which are not mentioned in localize.bat/localize.sh), then run
localize.bat/localize.sh. Then make sure that all strings in your .po
files are translated. ;)


If no, can I send translations from trunk as translations for
branches/fixes_1_0?


See above. Yes you can, but you will have untranslated strings in your
.po files as a result.

  Or they automatically trunk - branches/fixes_1_0 in server?

No.


Thanks for info.


--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] copy from topenglcontrol

2009-07-08 Thread Valdas Jankūnas

Andrea Mauri rašė:

Dear All,
there is a way to copy to clipboard or to save an image from a 
TOpenGLControl?

Thanks,
Andrea



 Take a look at this example: 
http://www.codeguru.com/forum/showthread.php?t=446641


--
  Valdas Jankūnas

--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus