[Lazarus] IDE: on deleting build-modes, I got change in .lpr file

2019-09-04 Thread Alexey Tor. via lazarus
I deleted 2 build modes, and diff shows that also the .lpr file was 
changed. Space was deleted near the :=.


--- a/app/cudatext.lpr
+++ b/app/cudatext.lpr
@@ -28,7 +28,7 @@ begin
   if Screen.MonitorCount>1 then
 Application.MainFormOnTaskBar:= True;
   {$IFEND}
-  Application.Title:= 'CudaText';
+  Application.Title:='CudaText';
   Application.Scaled:= false;
   RequireDerivedFormResource:= True;
   Application.Initialize;

--
Regards,
Alexey

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Cross-platform project. Font sizes not the same....

2019-09-04 Thread Kostas Michalopoulos via lazarus
I *highly* recommend to avoid changing font sizes, users select themes
because they want applications to use them, so it is better to stick
with their choices and use autosizing (the default setting for most
controls), the align property and the anchor editor.

Here is an old (but still valid) video i made ~6 years ago where i
quickly show the anchor editor in practice:
https://www.youtube.com/watch?v=neigk9Pt21o

Using the anchor editor you can create UIs that dynamically adjust
position and size based on the user settings and allow the user to
resize windows.

Generally speaking try to design UIs that use as little fixed
positioning as possible. Fixed positioning (that is, dragging and
dropping a control on the form and manually adjusting its position and
size there with the mouse) is fine for simple applications that will
only work on Windows or macOS that traditionally has kept font sizes
the same over the years (though even then on Windows you can use
different fonts and some people do), but on Linux you simply cannot
rely on anything to be constant and fixed positioning can only be used
as a starting point for your layout (ie. place the controls manually
in a fixed position+size and then open the anchor editor and start
stitching them together one by one - this is basically what i do in
the video above).

Kostas

On Thu, Aug 22, 2019 at 10:50 AM Bo Berglund via lazarus
 wrote:
>
> On Tue, 20 Aug 2019 23:47:39 +0200, Bo Berglund via lazarus
>  wrote:
>
> >I can go into the font property of affected controls and change the
> >font size to make it look better, but there are so many...
>
> In fact there are not that many controls so I tried to do the
> following on Windows:
>
> procedure TfrmMain.SetFontSize(S: integer);
> begin
>   // Set font size on load.
>   btnDec60.Font.Size := S;
>   btnDec30.Font.Size := S;
>   btnDec10.Font.Size := S;
>   btnDec1.Font.Size := S;
>   btnInc1.Font.Size := S;
>   btnInc10.Font.Size := S;
>   btnInc30.Font.Size := S;
>   btnInc60.Font.Size := S;
>   btnCutStart.Font.Size := S;
>   btnCutEnd.Font.Size := S;
>   btnAddCut.Font.Size := S;
>   btnJump.Font.Size := S;
>   btnShiftAudio.Font.Size := S;
>   speDelay.Font.Size := S;
>   stxCutStart.Font.Size := S;
>   stxCutEnd.Font.Size := S;
>   stxCutTime.Font.Size := S;
>   stxClipCnt.Font.Size := S;
>   gbxCut.Font.Size := S;
>   ckbLogin.Font.Size := S;
> end;
>
> procedure TfrmMain.FormShow(Sender: TObject);
> begin
>   SetFontSize(9);
> end;
>
> This  works just fine on Windows so I went to my RPi4 and opened the
> project there and added these two procedures also to that instance of
> the project, thinking it would at laset fix the font size temporarily.
> But when I run this I get an exception!
>
> -
> Debugger Exception Notification
> Project VideoPlayer raised exception class 'EReadError' with message:
> Invalid value for property
> At address C4920
>
> [] Ignore this exception type [Break] [Continue]
> -
>
> If I check the Ignore checkbox and contine I get another error:
>
> -
> Error reading frmMain.OnShow: Invalid value for property
> Press OK to ignore and risk data corruption
> Press Abort to kill the program
>[Abort]  [OK]
> -
>
> Strangely it did not manage to handle the integer value for font size
> so I redefined the SetFontSize procedure to be declared as follows:
>
> procedure TfrmMain.SetFontSize(S: shortint);
>
> With this in place the form in Linux became the same as on Windows
> size-wise regarding texts.
>
> Maybe a difference between the operating systems, I think Raspbian is
> still a 32 bit system whereas Lazarus on Window 7 x64 is a 64 bit
> program on a 64 bit OS.
>
> --
> Bo Berglund
> Developer in Sweden
>
> --
> ___
> lazarus mailing list
> lazarus@lists.lazarus-ide.org
> https://lists.lazarus-ide.org/listinfo/lazarus
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


[Lazarus] LazDataDesktop: transaction handling

2019-09-04 Thread Ondrej Pokorny via lazarus

Hello (Michael)!

I started to use LazDataDesktop because PgAdmin4 is horrible.

I have a problem with transactions with Postgres connection (well I 
tested only Postgres connection).


I found out that when using the SQL editor, I can type "COMMIT" and 
"ROLLBACK" - so far so good. (Well I would like to have a tool button 
for these commands but OK for now - I may add them in the future.)


The real problem: I cannot apply edited data from the DB grid. I keep 
getting this error:


I have clicked on the tick button - it got disabled. I have also clicked 
on the button next to refresh - well I don't know that the button does 
because it has no hint and caption, but I clicked on it nevertheless :) :


But still I get the error above and the data is not written.

How can I commit the changes made in the data grid?

Thanks
Ondrej

-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] LazDataDesktop: transaction handling

2019-09-04 Thread LacaK via lazarus
If data of underlaying TSQLQuery are presented and edited only thorought 
this DBGrid then I would add to TSQLQuery option "sqoAutoApplyUpdates".

(I am not familiar with architecture of LazDataDesktop)
Which causes that on every Post/Delete updates are applied to database.
There will remain option to commit or rollback changes.
L.

Dňa 4.9.2019 o 20:02 Ondrej Pokorny via lazarus napísal(a):


Hello (Michael)!

I started to use LazDataDesktop because PgAdmin4 is horrible.

I have a problem with transactions with Postgres connection (well I 
tested only Postgres connection).


I found out that when using the SQL editor, I can type "COMMIT" and 
"ROLLBACK" - so far so good. (Well I would like to have a tool button 
for these commands but OK for now - I may add them in the future.)


The real problem: I cannot apply edited data from the DB grid. I keep 
getting this error:


I have clicked on the tick button - it got disabled. I have also 
clicked on the button next to refresh - well I don't know that the 
button does because it has no hint and caption, but I clicked on it 
nevertheless :) :


But still I get the error above and the data is not written.

How can I commit the changes made in the data grid?

Thanks
Ondrej


-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] LazDataDesktop: transaction handling

2019-09-04 Thread Michael Van Canneyt via lazarus



On Thu, 5 Sep 2019, LacaK via lazarus wrote:

If data of underlaying TSQLQuery are presented and edited only thorought this 
DBGrid then I would add to TSQLQuery option "sqoAutoApplyUpdates".

(I am not familiar with architecture of LazDataDesktop)
Which causes that on every Post/Delete updates are applied to database.
There will remain option to commit or rollback changes.


The grid was never meant to be editable. I simply forgot to disable that.
(I myself never ever edit in a grid, it didn't appear in my head that
someone would do this)

But I will :
a) Add the sqoAutoApplyUpdates option.
b) Add buttons for more explicit transaction control.

Michael.
--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] LazDataDesktop: transaction handling

2019-09-04 Thread Ondrej Pokorny via lazarus

On 05.09.2019 8:20, Michael Van Canneyt via lazarus wrote:

The grid was never meant to be editable. I simply forgot to disable that.
(I myself never ever edit in a grid, it didn't appear in my head that
someone would do this)

But I will :
a) Add the sqoAutoApplyUpdates option.
b) Add buttons for more explicit transaction control.


Thank you Michael. I assume I can help you with that.

I can also help with the editable grid. Editing could be enabled only if 
the table has a primary key or a unique index, for example. I sometimes 
need to edit raw data when something went wrong during the 
development/debugging. (And I tend to be lazy to type an UPDATE 
statement manually although LazDataDesktop offers a template for it :) )


Ondrej

--
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus