Marc Weustink | 1 Jan 14:24

Re: Can't type [] {} in code editor under linux

Marc Santhoff wrote:
> Am Sonntag, den 31.12.2006, 16:42 +0100 schrieb Marc Weustink:
>> I used XKeyCodeToKeysym to retrieve all keysyms and that function
>> appears to be broken.
>> I now switched to XGetKeyboardMapping to retrieve all in one go (is also
>> more efficient) and that one reports the correct values.
> 
> May I ask, which X (.org or Free86) you use and what version? I'm using
> XKeyCodeToKeysym myself and if it is broken I have to take care ...

Both xorg-x11-6.8.2-37.FC4.49.2 and X-Win32 8.0.2216 (also xorg based)
have this problem.

You can check this by looking at the result for:
  XKeyCodeToKeysym(Display, N, M);

where N=10..20 and M=2..3

M=2,3 are the values of the 2nd keysym group and they result in 0, where
they (obviously) shouldn't be 0 if you look at the result of xmodmap

Marc

Lord Satan | 1 Jan 15:52
Picon
Lord Satan <reimgrab <at> web.de>

Re: Can't type [] {} in code editor under linux

On Sun, 31 Dec 2006 13:27:35 -0600 (CST)
Jesus Reyes <jesusrmx <at> yahoo.com.mx> wrote:

> Works here, thanks.
> 
Works for me, too. Thanks.

Alex | 2 Jan 00:47
Favicon
Gravatar

Example how to sort a TTreeView

First of all happy new year,

Can anybody show me how to sort a TTreeview? I am trying with the 
Customsort method but I don´t know how to call the right parameters.

|TTreeView.CustomSort(SortProc: TTreeNodeCompare): Boolean;| 
<http://www.lazarus.freepascal.org/lcl_doc/TCustomTreeView.html#link2668>

Could you show me a little example of how to declare the SortProc 
Variable of type TTreeNodeCompare?

Thank you for your help,
Alex

Darius Blaszijk | 2 Jan 01:02
Picon

Re: Example how to sort a TTreeView

This is the first hit Google gave me :)

http://users.iafrica.com/d/da/dart/Delphi/TTreeView/TTreeView_eg11.html

Darius

----- Original Message ----- 
From: "Alex" <alex <at> esolva.com>
To: <lazarus <at> miraclec.com>
Sent: Tuesday, January 02, 2007 12:47 AM
Subject: [lazarus] Example how to sort a TTreeView

> First of all happy new year,
>
> Can anybody show me how to sort a TTreeview? I am trying with the 
> Customsort method but I don´t know how to call the right parameters.
>
> |TTreeView.CustomSort(SortProc: TTreeNodeCompare): Boolean;| 
> <http://www.lazarus.freepascal.org/lcl_doc/TCustomTreeView.html#link2668>
>
> Could you show me a little example of how to declare the SortProc Variable 
> of type TTreeNodeCompare?
>
> Thank you for your help,
> Alex
>
>
>
>
> _________________________________________________________________
(Continue reading)

Alex | 2 Jan 02:04
Favicon
Gravatar

Re: Example how to sort a TTreeView

Thank you,

But almost I am really confused, that example is for Delphi, the 
TTreeView implementation of Lazarus is a little bit different, the 
number of parameters and declaration of CustomSort are different.
I just try with the example of the webpage and I get a compiler error:
Error: Incompatible type for arg no. 1: Got "<address of 
function(TTreeNode, TTreeNode, LongInt):LongInt;StdCall>", expected 
"<procedure variable type of function(TTreeNode, TTreeNode):LongInt of 
object;Register>"

Thank you for your help.
Alex

Darius Blaszijk wrote:
> This is the first hit Google gave me :)
>
> http://users.iafrica.com/d/da/dart/Delphi/TTreeView/TTreeView_eg11.html
>
> Darius
>
> ----- Original Message ----- From: "Alex" <alex <at> esolva.com>
> To: <lazarus <at> miraclec.com>
> Sent: Tuesday, January 02, 2007 12:47 AM
> Subject: [lazarus] Example how to sort a TTreeView
>
>
>> First of all happy new year,
>>
>> Can anybody show me how to sort a TTreeview? I am trying with the 
(Continue reading)

Christian Iversen | 2 Jan 15:19
Picon

Re: Console app problems

On Sunday 31 December 2006 01:51, Lee Jenkins wrote:
> Christian Iversen wrote:
> > I much prefer
> >
> > for X := 0 to 99 do
> > begin
> >   FooStuff();
> > end;
>
> Hmm.  That's nice too.

Naturally it's a matter of taste, but I really cannot get used to the 
indenting of begin-end. It just looks wierd to me, even after all these 
years.

It's something like

for (int x = 0; x < 99; x++)
  {
     FooStuff();
  }

Doesn't that look odd, too?

> > I used to Capitalize keywords too, but I've never only capitalized the
> > first keyword in a block - that's pretty obscure to me :)
>
> I'm a big "camel case" kind of guy.  I LikeToQuicklyUnderstand a line of
> text or variable name.  In Delphi, I use GExperts that will will
> captialize your keywords/vars for you.  Define it as "MyVar" and write
(Continue reading)

Marco van de Voort | 2 Jan 17:36
Picon
Favicon

Re: Console app problems

On Tue, Jan 02, 2007 at 03:19:32PM +0100, Christian Iversen wrote:
> It's something like
> 
> for (int x = 0; x < 99; x++)
>   {
>      FooStuff();
>   }
> 
> Doesn't that look odd, too?

No, why? I always do that.

Christian Iversen | 2 Jan 17:51
Picon

Re: Console app problems

On Tuesday 02 January 2007 17:36, Marco van de Voort wrote:
> On Tue, Jan 02, 2007 at 03:19:32PM +0100, Christian Iversen wrote:
> > It's something like
> >
> > for (int x = 0; x < 99; x++)
> >   {
> >      FooStuff();
> >   }
> >
> > Doesn't that look odd, too?
>
> No, why? I always do that.

I don't know, it just always looks odd to me. I prefer

for (..)
{
}

or even

for (...) {
}

which, imho, only looks good in C.

Then again, there are probably even more coding styles in Pascal than in C.

--

-- 
Regards,
(Continue reading)

Lee Jenkins | 2 Jan 19:33

Re: Console app problems

Christian Iversen wrote:
> On Sunday 31 December 2006 01:51, Lee Jenkins wrote:
>> Christian Iversen wrote:
>>> I much prefer
>>>
>>> for X := 0 to 99 do
>>> begin
>>>   FooStuff();
>>> end;
>> Hmm.  That's nice too.
> 
> Naturally it's a matter of taste, but I really cannot get used to the 
> indenting of begin-end. It just looks wierd to me, even after all these 
> years.
> 
> It's something like
> 
> for (int x = 0; x < 99; x++)
>   {
>      FooStuff();
>   }
> 
> Doesn't that look odd, too?
> 

This is exactly the way that I format those blocks in C#!

--

-- 

Warm Regards,
(Continue reading)

Giulio Bernardi | 2 Jan 21:10
Picon

[lcl internals] - keyboard handling

Hi,
even looking at sources of various interfaces, I cannot really understand 
how the interface should behave in respect to lcl when handling keyboard 
events.

Let's look at keydown case:

(note: for "event considered handled" I mean the interface should tell 
native widgetset that the event has been handled, that is, widgetset doesn't 
handle/propagate further that message)

a key has been pressed.
Interface sends a CN_(SYS)KEYDOWN message
  If lcl handles it (result<>0), interface should consider the event handled 
and stop there
  (no xx_char or utf8keypress). right?
  if lcl doesn't handle it, interface should proceed:
    if key was changed it has to stop. right? the event has to be considered 
handled?

Does the interface have to send a LM_(SYS)KEYDOWN message then? does it have 
to do the same checks it did for CN_KEYDOWN (handled by lcl/key changed 
etc)?

If the key is not "special" (like arrows, ins, canc, return, backspace and 
so on) interface
sends an utf8 char via IntUTF8KeyPress.
  if lcl handles it (result=true) interface should consider the event 
handled and stop
  there (no xx_char). right?
(Continue reading)


Gmane