Re: [Lazarus] Close all menu item ?

2020-03-23 Thread Michael Van Canneyt via lazarus



On Mon, 23 Mar 2020, Juha Manninen via lazarus wrote:


On Mon, Mar 23, 2020 at 2:35 PM Marco van de Voort via lazarus <
lazarus@lists.lazarus-ide.org> wrote:


Personally I hate the mandatory open project (or else the modal
options). E.g. you want to open a .lpk and you have to create a project
first to open the menu item.



Not really because a project is always opened automatically when you start
Lazarus.
It's either the previously used project or a new empty project.
The new empty project behaves almost like "no project" because you don't
have to save it.
IIRC the "Close Project" entry was added after a user request, but it is
rather useless. You cannot do much anything when projects are closed.
Everything is disabled then.
I also remember the initial confusion because of this feature but now it
feels very functional.
A project never needs to be closed explicitly, it gets closed when another
project is opened or when the whole IDE is closed.


Well, I think it does need to be closed from time to time.

Namely: I want to be sure that all is closed before doing an svn
update or git pull. Although many bugs have been fixed, still from time to
time when you do an update of files on disk, Lazarus messes up and
overwrites incoming changes.

These things are unfortunately very hard to reproduce. I have reported
several problems to Mattias, who promptly fixed them, but still it occurs
under hard-to-reproduce circumstances.

So, for safety, now I close the IDE, do the svn/git update, and then open the 
IDE.

In Delphi (which has the same problem with SVN/git/...), 
I don't close the IDE, I just close all files.


Luckily, the startup time of Lazarus is much shorter than Delphi's
(the latter easily takes up to a minute to start).

I could also temporarily open another project, but that is just as much a
kludge as closing the IDE, worse yet, I can inadvertently change that
project - and I know this from experience :(

So, yes, I would actually prefer that 'Close all' does what it says on the
tin, and really closes *all*.

That I cannot do anything after this till I have opened the project again, 
is quite OK with me. It would even be OK if it just automatically started an

empty new project after I did 'close all', as during startup. Just as long
as all previously opened files are closed.

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


Re: [Lazarus] Close all menu item ?

2020-03-23 Thread Juha Manninen via lazarus
On Mon, Mar 23, 2020 at 2:35 PM Marco van de Voort via lazarus <
lazarus@lists.lazarus-ide.org> wrote:

> Personally I hate the mandatory open project (or else the modal
> options). E.g. you want to open a .lpk and you have to create a project
> first to open the menu item.
>

Not really because a project is always opened automatically when you start
Lazarus.
It's either the previously used project or a new empty project.
The new empty project behaves almost like "no project" because you don't
have to save it.
IIRC the "Close Project" entry was added after a user request, but it is
rather useless. You cannot do much anything when projects are closed.
Everything is disabled then.
I also remember the initial confusion because of this feature but now it
feels very functional.
A project never needs to be closed explicitly, it gets closed when another
project is opened or when the whole IDE is closed.

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


Re: [Lazarus] Embedded VLC using PasLibVlc - how to fast forward?

2020-03-23 Thread Bo Berglund via lazarus
On Mon, 23 Mar 2020 08:38:37 +0100, Rolf Wetjen via lazarus
 wrote:

>Hi Bo,
>
>this could be a solution for windows (fullscreen):
>
>     SetWindowLongPtr(Handle,GWL_STYLE,iWindowStyle and not 
>WS_OVERLAPPEDWINDOW);
>     Left:=0;
>     Top:=0;
>     Width:=Screen.Width;
>     Height:=Screen.Height;
>
>Regards
>
>Rolf

Well, this seems to make the program window maximized and this is not
what I want.
I want the video port only to be maximized

Meanwhile I found an example inside the PasLibVlc source package where
there is a function that seems to do what I wanted so I tried to put
it into my code.
However, it does not show any video on the resulting form, it is all
black...
And it does not return to the application's previous form either when
I hit a keyboard key. The application's main window in this case is
all black, only the title bar is not black

Here is the code of the button event that is supposed to maximize my
window (copied from the example and adjusted for proper player name):


procedure TfrmMain.SpeedButton1Click(Sender: TObject);
var
//Defined in unit FullScreenFormUnit from the example:
  aFullScreenForm : TFullScreenForm; 
  oldL, oldT, oldW, oldH : Integer;
  oldA : TAlign;
begin
  MessageDlg('Press any key, to leave full screen mode',
mtInformation, [mbOK], 0);

  oldL := vlcPlayer.Left;
  oldT := vlcPlayer.Top;
  oldW := vlcPlayer.Width;
  oldH := vlcPlayer.Height;
  oldA := vlcPlayer.Align;

  if (oldA <> alNone) then vlcPlayer.Align := alNone;

  aFullScreenForm := TFullScreenForm.Create(SELF);
  aFullScreenForm.SetBounds(Monitor.Left, Monitor.Top, Monitor.Width,
Monitor.Height);

  // PasLibVlcPlayer1.ParentWindow := aFullScreenForm.Handle;
  {$IFDEF FPC}
LCLIntf.SetParent(vlcPlayer.Handle, aFullScreenForm.Handle);
  {$ELSE}
{$IFDEF MSWINDOWS}
  Windows.SetParent(vlcPlayer.Handle, aFullScreenForm.Handle);
{$ENDIF}
  {$ENDIF}
  vlcPlayer.SetBounds(0, 0, Monitor.Width, Monitor.Height);

  aFullScreenForm.ShowModal;

  vlcPlayer.SetBounds(oldL, oldT, oldW, oldH);
  {$IFDEF FPC}
LCLIntf.SetParent(vlcPlayer.Handle, SELF.Handle);
  {$ELSE}
{$IFDEF MSWINDOWS}
  Windows.SetParent(vlcPlayer.Handle, SELF.Handle);
{$ENDIF}
  {$ENDIF}

  aFullScreenForm.Free;

  if (oldA <> alNone) then vlcPlayer.Align := oldA;
end;



-- 
Bo Berglund
Developer in Sweden

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


Re: [Lazarus] Close all menu item ?

2020-03-23 Thread Mattias Gaertner via lazarus
On Mon, 23 Mar 2020 14:34:02 +0100
Martin Frb via lazarus  wrote:

> On 23/03/2020 13:35, Marco van de Voort via lazarus wrote:
> > Personally I hate the mandatory open project (or else the modal 
> > options). E.g. you want to open a .lpk and you have to create a 
> > project first to open the menu item.  
> 
> Well, this is not because it is desired. I doubt there would be 
> objection to changing it.
> 
> This is (afaik) only due to the initially (long ago) chosen design. 
> Today a lot of code, relies on the global "project" variable. So far
> I know of no one, who wants to rewrite all of this...

Yes, the design is that the session (open files, positions, jumps,
bookmarks, encoding, line ending, etc) are stored in the project.

A package needs the settings of the project, e.g. macros like
target OS/CPU.

So if you want to edit a package or files without any project, the
easiest way would be to implement a dummy/default project. Some
functions and menu items must be disabled. And some error messages must
be improved. 
The big questions are:
Should the IDE restore the dummy session after a restart? If yes, then
it must store the session and reload.
And if yes, should a Close All wipe the whole session, e.g. file
properties?


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


Re: [Lazarus] Close all menu item ?

2020-03-23 Thread Santiago A. via lazarus

El 23/03/2020 a las 10:55, Ondrej Pokorny via lazarus escribió:

On 23.03.2020 10:23, Michael Van Canneyt via lazarus wrote:
"Close all" in the file menu does not close the project inspector 
(and, I

suppose, the project)

Is this by design ? I'm asking because in Delphi 'Close all' really 
closes "all".


Hello,

yes this difference is by design. To close the project in Lazarus IDE 
you have to execute Project -> "Close Project" from the menu. File -> 
"Close all" closes all open editors.

Maybe the texto should be "Close all editors", then



Ondrej




--
Saludos

Santiago A.

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


Re: [Lazarus] Close all menu item ?

2020-03-23 Thread Martin Frb via lazarus

On 23/03/2020 13:35, Marco van de Voort via lazarus wrote:
Personally I hate the mandatory open project (or else the modal 
options). E.g. you want to open a .lpk and you have to create a 
project first to open the menu item.


Well, this is not because it is desired. I doubt there would be 
objection to changing it.


This is (afaik) only due to the initially (long ago) chosen design. 
Today a lot of code, relies on the global "project" variable. So far I 
know of no one, who wants to rewrite all of this...


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


Re: [Lazarus] Close all menu item ?

2020-03-23 Thread Marco van de Voort via lazarus


Op 2020-03-23 om 13:34 schreef Ondrej Pokorny via lazarus:
 reason for this behaviour ? It seems a bit strange to me to treat the 
project differently.


This feature is not from me. I was hit by it as well when I started 
using Lazarus. AFAIR it's been always so. I got used to it and I find 
it logical.


I set up Lazarus to remember open editors (to reopen them when a 
project is opened) and so after some time the count of open editors 
grows a lot. This is a way to close all editors easily and have a 
clean source editor. On the contrary, If I want to close the project 
and keep the open editors remembered, I use the "Close Project" menu 
item.


So for me Delphi should fix their behavior to match Lazarus :)

Personally I hate the mandatory open project (or else the modal 
options). E.g. you want to open a .lpk and you have to create a project 
first to open the menu item.

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


Re: [Lazarus] Close all menu item ?

2020-03-23 Thread Ondrej Pokorny via lazarus

On 23.03.2020 10:59, Michael Van Canneyt via lazarus wrote:

On Mon, 23 Mar 2020, Ondrej Pokorny via lazarus wrote:

On 23.03.2020 10:23, Michael Van Canneyt via lazarus wrote:
"Close all" in the file menu does not close the project inspector 
(and, I

suppose, the project)

Is this by design ? I'm asking because in Delphi 'Close all' really 
closes "all".


Hello,

yes this difference is by design. To close the project in Lazarus IDE 
you have to execute Project -> "Close Project" from the menu. File -> 
"Close all" closes all open editors.


OK, thank you.

Any particular reason for this behaviour ? It seems a bit strange to 
me to treat the project differently.


This feature is not from me. I was hit by it as well when I started 
using Lazarus. AFAIR it's been always so. I got used to it and I find it 
logical.


I set up Lazarus to remember open editors (to reopen them when a project 
is opened) and so after some time the count of open editors grows a lot. 
This is a way to close all editors easily and have a clean source 
editor. On the contrary, If I want to close the project and keep the 
open editors remembered, I use the "Close Project" menu item.


So for me Delphi should fix their behavior to match Lazarus :)

Ondrej

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


Re: [Lazarus] Close all menu item ?

2020-03-23 Thread Michael Van Canneyt via lazarus



On Mon, 23 Mar 2020, Ondrej Pokorny via lazarus wrote:


On 23.03.2020 10:23, Michael Van Canneyt via lazarus wrote:

"Close all" in the file menu does not close the project inspector (and, I
suppose, the project)

Is this by design ? I'm asking because in Delphi 'Close all' really 
closes "all".


Hello,

yes this difference is by design. To close the project in Lazarus IDE 
you have to execute Project -> "Close Project" from the menu. File -> 
"Close all" closes all open editors.


OK, thank you.

Any particular reason for this behaviour ? It seems a bit strange to me to
treat the project differently.

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


Re: [Lazarus] Close all menu item ?

2020-03-23 Thread Ondrej Pokorny via lazarus

On 23.03.2020 10:23, Michael Van Canneyt via lazarus wrote:

"Close all" in the file menu does not close the project inspector (and, I
suppose, the project)

Is this by design ? I'm asking because in Delphi 'Close all' really 
closes "all".


Hello,

yes this difference is by design. To close the project in Lazarus IDE 
you have to execute Project -> "Close Project" from the menu. File -> 
"Close all" closes all open editors.


Ondrej

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


[Lazarus] Close all menu item ?

2020-03-23 Thread Michael Van Canneyt via lazarus


Hi,

"Close all" in the file menu does not close the project inspector (and, I
suppose, the project)

Is this by design ? 
I'm asking because in Delphi 'Close all' really closes "all".


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


Re: [Lazarus] Gtk2 Linux detect user logoff?

2020-03-23 Thread Michael Van Canneyt via lazarus



On Mon, 23 Mar 2020, Anthony Walter via lazarus wrote:


Does anyone here know how to detect user log off and gracefully terminate
under Gtk2 Linux? I have an app which uses some temporary files (in /tmp)
and I want to ensure those files are deleted when the user logs off. The
application query/end session events don't seem to be connected when using
the Gtk2 widgetset.


From this stack overflow answer it would seem there is a 'save-yourself'

sinal to notify you when the user logs off, but I don't know what the LCL
value of client might be. Could it be application handle? Is there a better
way to detect user log off on Gtk2?

https://stackoverflow.com/a/2519829/269630


I suspect this is a dbus signal. 
Maybe gnome API interfaces expose an api for the signals of the session

manager. I doubt GTK handles these signals, and I don't think Lazarus uses
the Gnome signals or the Gnome API.

So I would attempt to connect to the gnome session manager using dbus. 
FPC has a DBUS client component, so this should not be too hard.


I have some uncommitted example programs that may help you if you decide to
go this path.

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


Re: [Lazarus] Embedded VLC using PasLibVlc - how to fast forward?

2020-03-23 Thread Rolf Wetjen via lazarus

Hi Bo,

this could be a solution for windows (fullscreen):

    SetWindowLongPtr(Handle,GWL_STYLE,iWindowStyle and not 
WS_OVERLAPPEDWINDOW);

    Left:=0;
    Top:=0;
    Width:=Screen.Width;
    Height:=Screen.Height;

Regards

Rolf

Am 23.03.2020 um 07:52 schrieb Bo Berglund via lazarus:

On Sun, 22 Mar 2020 22:29:15 +0100, Bo Berglund via lazarus
 wrote:

FOLLOW-UP:


1) FF video playback

I found an example that handles the play speed and could verify it
thus:
vlcPlayer.SetPlayRate(newPlayRate);

newPlayRate is an integer seemingly in percent of normal speed, so:
x2 = 200
x1 = 100
x0.5 = 50
etc

vlcPlayer.GetPlayRate() reads back the current rate.

Still looking for the maximize function, but it is not so needed as
was the speed.




--
Diese E-Mail wurde von Avast Antivirus-Software auf Viren geprüft.
https://www.avast.com/antivirus

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


[Lazarus] Gtk2 Linux detect user logoff?

2020-03-23 Thread Anthony Walter via lazarus
Does anyone here know how to detect user log off and gracefully terminate
under Gtk2 Linux? I have an app which uses some temporary files (in /tmp)
and I want to ensure those files are deleted when the user logs off. The
application query/end session events don't seem to be connected when using
the Gtk2 widgetset.

>From this stack overflow answer it would seem there is a 'save-yourself'
sinal to notify you when the user logs off, but I don't know what the LCL
value of client might be. Could it be application handle? Is there a better
way to detect user log off on Gtk2?

https://stackoverflow.com/a/2519829/269630
-- 
___
lazarus mailing list
lazarus@lists.lazarus-ide.org
https://lists.lazarus-ide.org/listinfo/lazarus


Re: [Lazarus] Embedded VLC using PasLibVlc - how to fast forward?

2020-03-23 Thread Bo Berglund via lazarus
On Sun, 22 Mar 2020 22:29:15 +0100, Bo Berglund via lazarus
 wrote:

FOLLOW-UP:

>1) FF video playback
I found an example that handles the play speed and could verify it
thus:
vlcPlayer.SetPlayRate(newPlayRate);

newPlayRate is an integer seemingly in percent of normal speed, so:
x2 = 200
x1 = 100
x0.5 = 50
etc

vlcPlayer.GetPlayRate() reads back the current rate.

Still looking for the maximize function, but it is not so needed as
was the speed.


-- 
Bo Berglund
Developer in Sweden

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