Re: [Lazarus] Memo for touchscreen

2013-08-27 Thread Malcolm Poole

On 26/08/13 20:33, Koenraad Lelong wrote:


procedure TForm1.LetterAButtonClick ( Sender: TObject ) ;
var
testcaretpos: Integer;
begin
testcaretpos := Memo1.SelStart;
Memo1.Text := Copy(Memo1.Text, 1, testcaretpos) + 'A'
+ Copy(Memo1.Text, testcaretpos+1, MaxInt);
Inc(testcaretpos);
Memo1.SelStart := testcaretpos;
Memo1.SetFocus;
end;



I made a few testprograms that work fine with your code. Now I made a
full keyboard (Belgian AZERTY) and I'm having a problem I can't solve.

The keyboard has some special characters : é§èçà and others. Those are
not 1 byte characters. When I add them, they appear in the memo, but the
next character seems to erase the memo. If I have already some lines in
it, all disappears and the cursor is on the first line, fully left.
I add the characters with a string :

Kars:='§';
Memo1.Text := Copy(Memo1.Text, 1, testcaretpos) + Kars +
Copy(Memo1.Text, testcaretpos+1, MaxInt);



This happens because '§' and the other 'characters' are represented in 
UTF8 by more than one byte.


I reproduced your problem and got around it by replacing
Inc(testcaretpos);
by
Inc(testcaretpos, Length(Kars));

I don't know what consequences this might have for your navigation using 
the arrow keys, though: I haven't had much experience working with 
multibyte chars.


Hope this helps, anyway.

Malcolm



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


Re: [Lazarus] Memo for touchscreen

2013-07-19 Thread Malcolm Poole

On 19/07/13 13:45, Koenraad Lelong wrote:

Works fine, except for navigating up and down. Left and right is OK, I
have to find out how to know on what line the cursor is, and then going
to the next/previous line, if possible.


Well I did say it was only to get you started :D

Memo1.CursorPos.y will tell you on which line the cursor is.

Here's a suggestion for navigating to the line above. I'll leave it to 
you to work out how to navigate to the line below.


Malcolm

==

procedure TForm1.UpButtonClick ( Sender: TObject ) ;
var
  newcaretPos: Integer;
  x: Integer;
begin
  newcaretPos := 0;
  writeln(Memo1.CaretPos.Y, #32, Memo1.CaretPos.X);
  for x := 0 to Memo1.CaretPos.Y-2 do
newcaretPos := newcaretPos + Length(Memo1.Lines[x]) + 
Length(LineEnding);

  if Length(Memo1.Lines[Memo1.CaretPos.Y-1])  Memo1.CaretPos.X
 then newcaretPos := newcaretPos + 
Length(Memo1.Lines[Memo1.CaretPos.Y-1]) + 1

 else newcaretPos := newcaretpos + Memo1.CaretPos.X;
  Memo1.SelStart := newcaretPos;
  Memo1.SetFocus;
end;




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


Re: [Lazarus] Memo for touchscreen

2013-07-18 Thread Malcolm Poole

On 18/07/13 12:54, Koenraad Lelong wrote:

For a touchscreen-application  (so no real keyboard) I need something
like a memo.
I first tried a memo, but how do I enter text at the caret ? And the
caretpos is readonly.
Next I tried synMemo, but if I move the caret, the caret disappears. How
can I show it ?
How do I send a BackSpace, Delete ?
How do I hide the rightedge of the synMemo ? Just set it to the
backgroundcolor ?

Is there a better component ?


TMemo should work - just use SelStart instead of CaretPos.

Try the code below to get you started: Form with a Memo and 2 buttons, 
named LetterAButton and DeleteButton.


Regards,

Malcolm

//

procedure TForm1.LetterAButtonClick ( Sender: TObject ) ;
var
  testcaretpos: Integer;
begin
  testcaretpos := Memo1.SelStart;
  Memo1.Text := Copy(Memo1.Text, 1, testcaretpos) + 'A'
+ Copy(Memo1.Text, testcaretpos+1, MaxInt);
  Inc(testcaretpos);
  Memo1.SelStart := testcaretpos;
  Memo1.SetFocus;
end;

procedure TForm1.DeleteButtonClick ( Sender: TObject ) ;
var
  testcaretpos: Integer;
begin
  testcaretpos := Memo1.SelStart;
  Memo1.Text := Copy(Memo1.Text, 1, testcaretpos)
+ Copy(Memo1.Text, testcaretpos+2, MaxInt);
  Memo1.SelStart := testcaretpos;
  Memo1.SetFocus;
end;



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


Re: [Lazarus] FirePOS (was: PDF in a Form)

2013-07-13 Thread Malcolm Poole

On 13/07/13 19:06, Koenraad Lelong wrote:

Op 13-07-13 18:40, Paul Breneman schreef:


Thank you *very* much Koenraad for mentioning that this project uses
fpGUI.  I didn't find any docs at the site but I hope to study the code
more ASAP.  It is very interesting to see a fpGUI program set up for use
with a touchscreen!  I've started down that path myself.

It seems to be setup to use Lazarus?  I didn't think fpGUI support in
Lazarus was very complete but maybe things have been improved recently?


Paul,

The code is managed with Lazarus, I think. The GUI is made with
fpgui-designer or what's it called ?


Koenraad is correct, the module that uses fpgui was designed using the 
uidesigner application that comes with fpgui. All the other coding was 
then done using Lazarus.


Malcolm

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


Re: [Lazarus] PDF in a Form

2013-07-12 Thread Malcolm Poole

On 12/07/13 16:13, Reinier Olislagers wrote:

On 12-7-2013 4:42, Edgar García wrote:

 I'm new to Lazarus and would like to know how I can display a PDF in a
Form ...


Have a look here:
http://forum.lazarus.freepascal.org/index.php/topic,20221




Also for a simpler example and more up-to date version of the bindings 
mentioned in that thread:

http://code.google.com/p/firepos/source/browse/#svn%2Ftrunk%2FmuPDFlaz

Malcolm


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


Re: [Lazarus] Touchscreen

2013-06-30 Thread Malcolm Poole

On 30/06/13 09:38, Koenraad Lelong wrote:

I made some test-apps, and I think there will be problems with things
like scrollbars. Is there a way to make those bigger ? Or is there a way
to implement the swipe to move items in a list ?


I decided to use fpgui for this; because it made it relatively easy to 
get into the GUI code and make the scrollbars wider.


Another way which I found used by a number of applications (and also by 
making supermarket cashiers nervous by trying to look at their POS 
screens) is to hide the scrollbars and have two large buttons alongside, 
with up/down arrows or forward/back arrows.


Regarding the swipe, I hadn't thought of it before, but it may be 
possible to use the mouse scroll events in a  touchscreen application, 
to achieve the same effect.


Malcolm


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


Re: [Lazarus] terminal window not displayed in lazarus on kubuntu linux

2013-01-18 Thread Malcolm Poole

On 18/01/13 11:25, Paul wrote:

I am running kubuntu linux which runs KDE as the desktop and have
installed lazarus 1,0,4, FPC version 2.6.0. x86_64-linux-gtk2.
The problem:
When I choose run, the program compiles just fine but the output is not
displayed in a terminal window.  This happens with all of my programs
running on lazarus.
I have the same lazarus, fpc and programs running on windows and on
windows as soon as the program is compiled a terminal window pops up and
displayed the results.


From the 'Run' menu, select 'Run Parameters' and check 'Use Launching 
Application'. If Lazarus complains that it can't find the launching 
application, choose another from the combobox list


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


Re: [Lazarus] Lazarus 1.0 Release

2012-08-29 Thread Malcolm Poole

On 29/08/12 18:51, Mattias Gaertner wrote:

The Lazarus team is glad to announce the release of:

 Lazarus 1.0




Congratulations and many thanks to everyone who has contributed to this 
great programming tool.


Malcolm

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


Re: [Lazarus] Policy regarding HTML messages

2012-08-26 Thread Malcolm Poole

On 26/08/12 00:29, Graeme Geldenhuys wrote:

* Even setting your email client (I use Mozilla Thunderbird) to prefer
plain text in a multi-part message, the HTML part shows up as an
attachment. A huge annoyance for me when I search for important message
that had valid (read real) attachments.


I have no argument with your other points, Graeme, but on my Thunderbird 
setup (10.0.2 on Debian) the only attachments that appear are genuine 
ones, suggesting that it can be set up to ignore HTML attachments - I've 
no idea how, though, and I certainly can't recall setting it up that way.


Anyway, you will no doubt be aware that I was blissfully ignorant of the 
number of HTML messages posted, although having now checked my settings 
it appears that I was one of the guilty. This should no longer be the 
case :)


Malcolm

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


Re: [Lazarus] FPC/Lazarus based backup system

2011-08-21 Thread Malcolm Poole

On 21/08/11 18:30, ik wrote:
Does any of you know of a good backup system written using 
FPC/Lazarus, working inside Linux and open source ?
Probably not exactly what you're looking for, but Dargui ( 
http://dargui.sourceforge.net/ ) is a front end for the Dar archiving 
utility and is developed using Lazarus.


Malcolm

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


Re: [Lazarus] Using Visual C++ .libs?

2011-06-01 Thread Malcolm Poole

On 01/06/11 13:13, Prado, Renato (R.P.) wrote:

You'll have to implement an wrapper, that allows to access the objects
and their methods by mere (non-OO) subroutines. That wrapper will have
to be written in the language of the library (here: C++), so that it

can

use the objects provided by the library, and can call their methods.

The

headers of the wrapper have to be converted into a unit (library?),


By wrapper you mean generating a unit translating the interface from the
.h right? After I got the unit, how can I link the .lib into my project?
I would not like to create a DLL in Visual C++ with the .lib inside just
to be able to use the .lib functions within Lazarus.
I can recommend the guide to using C in Freepascal projects at 
ftp://ftp.freepascal.org/pub/fpc/docs-pdf/CinFreePascal.pdf


I used it as a manual when writing a simple interface to the tesseract 
OCR library, which is also a C++ library.


Malcolm

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


Re: [Lazarus] Terminal in Lazarus

2011-05-01 Thread Malcolm Poole

On 30/04/11 21:37, Geoffray Levasseur wrote:

Le dimanche 17 avril 2011 23:43:01, Malcolm Poole a écrit :

It is possible to embed a libvte terminal in a lazarus form when using
GTK and control it from the application, although I'm not sure if it's
possible to do everything that you want.

Pascal bindings for libvte and a test application can be found at
http://dargui.svn.sourceforge.net/viewvc/dargui/testvte/

I'm trying to use your VTE implementation (with the help of the demo app) and
I'm facing a problem that I can't understand: impossible to get the shell
working even if the VTE widget is appearing correctly and no errors happens
according to my log file.

Here is the source code for the application I'm trying to create (with svn):
svn://svn.tuxfamily.org/svnroot/geofperspage/gppsvn/trunk/lfs-manager

Can someone take a look and tell me what can be wrong (I've checked everything
without success).

I'm not clear what you're trying to do, as I cannot load your project 
fully or compile it due to the absence of cmdbox, LCLBase and FCL 
packages on my system, but you need to remove line 206  
Terminal.Execute;   from fMain. Your GTKTerm should then work as a 
normal embedded shell.


The command 'Execute' is used when the terminal has been created with a 
command as parameter - see explanatory notes at line 41 of VTETerminal.pas


I'm not sure if it is possible to execute more than one command remotely 
on the same terminal - closer examination of the GTK VTETerminal 
documentation would probably provide this information.


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


Re: [Lazarus] Terminal in Lazarus

2011-04-17 Thread Malcolm Poole

On 16/04/11 11:39, Geoffray Levasseur wrote:

Hi,

I'm trying to create a build manager for own compiled package. The project is
in a good way but the next step is a bit hard for me. To complete the
software, I need to have an integrated terminal. Here are the constraint:
  1 - I need to be able to use environment variable, so once the terminal is
open it will use the same shell until the job is complete.
  2 - Each command (sometimes complex ones, e.g. for and if statement) will
be added line by line (from a TString) at runtime and each time a command is
complete I need to now its exit code.
  3 - As this will be most of the time bash (or zsh if the user chose this),
the shell can change at runtime with perl or python. I still must be able to
interact with those shell.
  4 - The terminal will be embedded in a Lazarus form (do not matter if it's
created at runtime).
  5 - Ideally all the output can be logged in a text file.

In fact the best will be something like an xterm clone but in pascal...

Any ideas on how to do this?
It is possible to embed a libvte terminal in a lazarus form when using 
GTK and control it from the application, although I'm not sure if it's 
possible to do everything that you want.


Pascal bindings for libvte and a test application can be found at
http://dargui.svn.sourceforge.net/viewvc/dargui/testvte/

Malcolm

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


Re: [Lazarus] How to minimize/restore lazarus (Ubuntu)?

2011-04-12 Thread Malcolm Poole

On 12/04/11 15:22, ik wrote:
2011/4/11 Flávio Etrusco flavio.etru...@gmail.com 
mailto:flavio.etru...@gmail.com


 (...)
 When doing this I had to look at files from the test
application and
 then code back and forth. But it was very annoying that it
seems not
 to be possible to minimize Lazarus and then clicking the
Lazarus icon
 on the task bar to bring it all back up.
 There are a whole bunch of buttons on the task bar all having the
 Lazarus icon and when I click them I only get a single window
of the
 IDE visible each time. So I have to click them in turn one by one.

 Why is this so (at least in Ubuntu 10)?

These are the default behaviors of the platforms. Unfortunately
there's no Window Manager for Linux/X that can automatically group
windows of a process :-(


Sure you have. I have it on my KDE (that I do not use it, but it's 
there), and I'm sure others also have it.
On Mandriva 2010.2 using KDE, if i minimize the principal Lazarus IDE 
menu window, all the other windows are minimized too. If I then restore 
the main window, all the other windows are also restored.


I didn't do anything to set this up - it seems to be the default on this 
system and version (Lazarus SVN 27340)
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] Where is fp ide located on my Mint 10 Linux system (ubuntu based)?

2010-12-31 Thread Malcolm Poole

On 29/12/10 19:08, Peter Williams wrote:

  If those binaries are in your path then `which fp` and `which fpc`
  should say where the programs are installed/located.

I don't know where they are installed/located. The software manager 
application does not tell me. It simply installs them.


Assuming that your software manager is Synaptic and that you used it to 
install fp:


1. Open Synaptic
2. use the 'Search' option - look for fp- because fpc on debian/ubuntu 
is contained in a number of packages eg fp-ide, fp-units-gtk, etc
3. highlight the fp-ide unit by clicking on it, then click on the 
'Properties' button in the toolbar. A window will appear with a number 
of tabs, one of which is 'Installed files'. _If_ the package has been 
installed this tab will provide a list of all files installed by the 
package and their location.


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


Re: [Lazarus] Serial communication??

2010-10-01 Thread Malcolm Poole

On 01/10/10 19:53, Bo Berglund wrote:

The problem is that I have no clue as to *where* Lazarus is installed. I
used the Synaptic Package Manager and let it find and install Lazarus for
me (on Ubuntu 10.04-2). I was not asked where it should go, it just
installed
And being a Linux newbie (I installed this Ubuntu machine last Sunday) I
don't know where programs go in the confusing file system.
Probably a silly and stupid question, but how can I find the install
directory of any program in Linux?

   
Reopen the Synaptic package manager and highlight Lazarus. Then click on 
Properties and you will find a list of the files that were installed 
and their location.


If only you could do that with a Windows installation file ;-)

Malcolm


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


Re: [Lazarus] Commercial projects

2009-10-03 Thread Malcolm Poole

Ger Remmers wrote:
The management is asking for examples of commercial projects currently being 
developed or in use. Can anyone provide me with links?
  

I don't know if Lazarus is used in developing the Weather Display app
(http://www.weather-display.com/index.php)
but the error messages on their forum at
http://www.weather-watch.com/smf/index.php?topic=41504.msg340979
indicate that it uses freepascal.

A selection of applications developed using Lazarus can be found at
http://wiki.freepascal.org/Lazarus_Application_Gallery and there are
some others among the projects at
http://wiki.freepascal.org/Projects_using_Lazarus, for example  Tony
Maro's Truckbites (http://www.truckbites.com) http://www.truckbites.com

Malcolm


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