Re: [Lazarus] Detect that component selected in OI.

2016-05-21 Thread Vojtěch Čihák

That's something else. I need something that will be part of component. 
Something like overriden SetFocus; or so.
So far I tried CMDesignHitTest and DoEnter but it didn't work.
It's like when you design Form with PageControl and two TabSheets. You select the second 
TabSheet in OI and PageControl "knows" it and it changes the tabs on the form. 
I'd like to know how this works (what component's code allows this).
 
Thanks, V.
__

Od: Howard Page-Clark 
Komu: lazarus@lists.lazarus.freepascal.org
Datum: 21.05.2016 20:18
Předmět: Re: [Lazarus] Detect that component selected in OI.



TObjectInspectorDlg has several public properties that may help:

Selection: TPersistentSelectionList
OnSelectionChange: TNotifyEvent
OnSelectPersistentsInOI: TNotifyEvent

also a boolean property EnableHookGetSelection which gives you access to 
protected get/set selection handlers.


There are possibly other relevant methods too, it is a complex class.

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


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


Re: [Lazarus] Detect that component selected in OI.

2016-05-21 Thread Howard Page-Clark

On 21/05/16 18:48, Vojtěch Čihák wrote:


is there some event (message or method) triggered when component is selected in 
OI?
It's just like PageControl and its TabSheets. When you select TabSheet in OI, 
component
is repainted in form designer. I oberved the code but I didn't find solution.


TObjectInspectorDlg has several public properties that may help:

Selection: TPersistentSelectionList
OnSelectionChange: TNotifyEvent
OnSelectPersistentsInOI: TNotifyEvent

also a boolean property EnableHookGetSelection which gives you access to 
protected get/set selection handlers.


There are possibly other relevant methods too, it is a complex class.

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


Re: [Lazarus] cthread library for fpc 3.0 on raspberry pi. - SOLVED

2016-05-21 Thread Graeme Geldenhuys
On 2016-05-21 18:45, Donald Ziesig wrote:
> Simply adding the line {$define 
> UseCThreads} into the define.inc file caused the execution to succeed 
> and play sounds.,


Well done Donald. Glad you got it sorted out. ;-)

Regards,
  Graeme


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


[Lazarus] Detect that component selected in OI.

2016-05-21 Thread Vojtěch Čihák
Hi,
 
is there some event (message or method) triggered when component is selected in 
OI?
It's just like PageControl and its TabSheets. When you select TabSheet in OI, 
component
is repainted in form designer. I oberved the code but I didn't find solution.
 
Thanks, V.

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


Re: [Lazarus] cthread library for fpc 3.0 on raspberry pi. - SOLVED

2016-05-21 Thread Donald Ziesig

On 05/20/2016 06:04 PM, Donald Ziesig wrote:

Hi All!

I'm still trying to play audio on my Raspberry Pi B 2 using FPC 3.0 
and Lazarus 1.7 using UOS.


After help from Graeme and Mattias, (many thanks) I was able to get 
UOS to compile, but when I try to run the demo programs I get Runtime 
Error 232.  This implies that I do not have the appropriate cthread 
library installed on the Pi.  Can anyone tell me what file(s) I need 
and where to get them?


I am able to compile and run the demos on my Linux Mint 17.2 laptop.

Thanks,

Don Ziesig

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


It took a while, but I finally figured out how to get the audio to play 
on my Raspberry Pi using UOS.


I never did notice that the "cthread," line in the demo's lpr file was 
grayed out.  This meant that the conditional compilation directives were 
eliminating that line from the code.   Simply adding the line {$define 
UseCThreads} into the define.inc file caused the execution to succeed 
and play sounds.,


I am not sure why this was defined by default on my Laptop and not on 
the Pi, but that is all that was wrong.


Thanks again for the help.  Now I am off to work fixing the target app 
by rewriting the PlayAudio object to use UOS rather than omxplayer.


Don Ziesig

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


Re: [Lazarus] Example of TObjectList sorting

2016-05-21 Thread Richard Mace
Hi Denis,

Thanks for your reply.

On 9 May 2016 at 13:24, Denis Kozlov  wrote:

> On 9 May 2016 at 12:48, Richard Mace  wrote:
>
>> I have a TObjectList that contains many objects that have a property
>> called "Position" which is an integer.
>>
>> Could somebody show me an example of the code that I will need to create
>> that will sort all of my Objects within the TObjectList so that they are in
>> position order e.g. 1,2,3,4,5 and so on?
>>
>
> Call TList.Sort method and supply a comparison function.
>
>
> For example:
>
> List.Sort(@CompareByPositionPtr);
>

​Would I call the List.sort externally, or would the List call sort when an
Add has happened, as I don't seem to have a ".sort" method on my
TObjectList?

Thanks​

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