Re: [Lazarus] Strange interaction between combox and IniPropStorage

2015-08-12 Thread Luca Olivetti

El 11/08/15 a les 12:22, Luca Olivetti ha escrit:

El 11/08/15 a les 12:12, Luca Olivetti ha escrit:

I just found a very strange bug:
when I try to save the ItemIndex of a combobox through a
TIniPropStorage, its value reverts to the value it had when the form was
created.
Every other value (I use TEdit.Text and TSpinEdit.Value) is correctly
saved, it's just the TCombobox.Itemindex that does that *unless* I
reference it before the TIniPropstorage tries to save it.
I attached a sample project in this bug:

http://bugs.freepascal.org/view.php?id=28514

I suppose it's a regression, since I have used this combination
(combobox and inipropstorage) in many projects and never saw this before.

Note that if you just create a new project and put the combobox and the
inipropstorage on the main form, it works fine, maybe it has something
to do with the ShowModal I'm using to show the form.



Nope, I tried also with a plain Show and it happens just the same (even
tried to set the modalResult of both buttons to mrNone).



Definitely a regression: I just had to modify an old program (where this 
feature worked) and it doesn't work anymore :-(

At least the workaround seems to do the job.

Bye
--
Luca Olivetti
Wetron Automation Technology http://www.wetron.es/
Tel. +34 93 5883004 (Ext.3010)  Fax +34 93 5883007

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


Re: [Lazarus] help needed making an ide extension

2015-08-12 Thread Marc Santhoff
On Do, 2015-08-13 at 01:06 +0200, Mattias Gaertner wrote:
 On Thu, 13 Aug 2015 00:06:34 +0200
 Marc Santhoff m.santh...@web.de wrote:
 
 [...]
  Good example.
  
  I do not fully understand the creation mechanism. I see an extra
  register procedure in frmexploremenu.pas that actually sets the menu
  entry. I thought a constructor of the extension class would be called.
  But since it is a modal form that is done by execution of the menu code.
  
  Instead there is a notify event FormCreate(), where is that one
  called? Is it done that way by convention? Did I miss some piece of
  documentation?
 
 It is set by the lfm, which is parsed in the forms constructor.

I see, time to activate some code in the IDE instead of only reading it.
 
 [...]
   It opens all forms of the project.
  
  OK, not what I want. What strategy can be used to get a list of forms in
  the users project without having to open them all?
 
 If you need the list of all units with designer, you can simply search
 for lfm files.
 If you want only specific classes, you have to check each lfm.

Simple and effective. Beautiful.

 [...]
Afterwards, will the new component created and have owner, parent and
essential properties set and then added, like I would do in any other
program creating components in code at runtime or is there another way
(sth. like IDEDoCreateComponetntAndAdd(newcomponent.class))?
   
   Maybe such a function can be added to the IDEIntf.
  
  In principle making something like designer/designer.pp
  TDesigner.MouseUpOnControl AddComponent publicly available would
  suffice.
 
 It needs various parameters:
 ComponentClass
 ParentComponent
 Left,Top,
 Optional: Width,Height
 Optional: Name
 
 Would that suffice?

From my POV it would, although I'm not the most experienced extension
developer. ;)

   Can you give some more details what you are trying to achieve?
  
  I'm only learning how to do basic actions. Playing around, that is.
  
  Currently it is planned to show a list of available forms and let the
  user select one. Then he would select the parent component for one or
  more new components to insert.
 
 Just an idea: Why not select the form and parent component, by right
 clicking on the parent component and start the wizard via a menu item
 in the popup menu?

Neat, would save some dialog space and maybe one step. For usability
there should be a menu item at the standard location, but that's another
question.


Thanks again,
Marc

-- 
Marc Santhoff m.santh...@web.de


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


Re: [Lazarus] help needed making an ide extension

2015-08-12 Thread Mattias Gaertner
On Thu, 13 Aug 2015 00:06:34 +0200
Marc Santhoff m.santh...@web.de wrote:

[...]
 Good example.
 
 I do not fully understand the creation mechanism. I see an extra
 register procedure in frmexploremenu.pas that actually sets the menu
 entry. I thought a constructor of the extension class would be called.
 But since it is a modal form that is done by execution of the menu code.
 
 Instead there is a notify event FormCreate(), where is that one
 called? Is it done that way by convention? Did I miss some piece of
 documentation?

It is set by the lfm, which is parsed in the forms constructor.

 
[...]
  It opens all forms of the project.
 
 OK, not what I want. What strategy can be used to get a list of forms in
 the users project without having to open them all?

If you need the list of all units with designer, you can simply search
for lfm files.
If you want only specific classes, you have to check each lfm.

[...]
   Afterwards, will the new component created and have owner, parent and
   essential properties set and then added, like I would do in any other
   program creating components in code at runtime or is there another way
   (sth. like IDEDoCreateComponetntAndAdd(newcomponent.class))?
  
  Maybe such a function can be added to the IDEIntf.
 
 In principle making something like designer/designer.pp
 TDesigner.MouseUpOnControl AddComponent publicly available would
 suffice.

It needs various parameters:
ComponentClass
ParentComponent
Left,Top,
Optional: Width,Height
Optional: Name

Would that suffice?
 
  Can you give some more details what you are trying to achieve?
 
 I'm only learning how to do basic actions. Playing around, that is.
 
 Currently it is planned to show a list of available forms and let the
 user select one. Then he would select the parent component for one or
 more new components to insert.

Just an idea: Why not select the form and parent component, by right
clicking on the parent component and start the wizard via a menu item
in the popup menu?

 All done from a modal form, and if
 feasible it will evolve to some sort of multi step wizard or
 assistant dialog triggering complex actions.

Mattias

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


[Lazarus] Error when building with my package. What's the problem?

2015-08-12 Thread Anthony Walter
Error received:

project1.lpr(20,1) Error: Undefined symbol: RTTI_$CODEBOT.SYSTEM_$$_DEF38

I updated FPC/Lazarus from svn sources recently and am attempting to
rebuild my personal source code packages. When I try to add these packages
to the IDE and rebuild, or even when I try to build a project with my
package as a requirement I am receiving the error message above and the
builds stop.

Does anyone know what the error of at the top of this message signifies and
how to fix it?

My package units use dotted the naming conventions such as:

Codebot.System in 'codebot.system.pas'
Codebot.Networking.Web in 'codebot.networking.web.pas'

I am not sure if this is contributing to the error. For reference here are
package sources:

https://github.com/sysrpl/Cross.Codebot
--
___
Lazarus mailing list
Lazarus@lists.lazarus.freepascal.org
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus


Re: [Lazarus] help needed making an ide extension

2015-08-12 Thread Mattias Gaertner
On Wed, 12 Aug 2015 21:16:22 +0200
Marc Santhoff m.santh...@web.de wrote:

[...]
 1. Is it correct that to make an extension basically all I have to do is
 write the code that
 - adds a menu entry for starting the code
 - save it as a lazarus package and check register in ide (or the
 like ;)
 and that's the basis for doing something useful?

Yes, see for example examples/exploremenu.

 
 2. When I want the user to select a form for the ide expert to work on,
 a list of available forms is needed. Is iterating over all the projects
 files and getting the form of a file the right way to go?

It depends on what you mean with available.
For example a project can also access the forms of packages.


 Additionally if yes:
 
 The code there:
 
 http://wiki.lazarus.freepascal.org/Extending_the_IDE#Get_unit.2C_designer.2C_form_of_a_file
 
 looks OK, but doesn't it open all the files of a project?

It opens all forms of the project.


 And does 
 
 // get form
 aForm:=aDesigner.Form;
 
 give NIL if the file has no form?

aDesigner will be nil.

 
 3. How do I create a new component on a form?
 For doing so one would need at least a reference to the active form and
 second a reference to the active component to use as parent.

Adding a component can be complex.
See designer/designer.pp TDesigner.MouseUpOnControl AddComponent.

 
 Afterwards, will the new component created and have owner, parent and
 essential properties set and then added, like I would do in any other
 program creating components in code at runtime or is there another way
 (sth. like IDEDoCreateComponetntAndAdd(newcomponent.class))?

Maybe such a function can be added to the IDEIntf.
Can you give some more details what you are trying to achieve?

 
 If there is an example doing all of this stuff, please point me there.
 After browsing some intresting names in lazarus/examples I haven't found
 what's missing.

Mattias

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


Re: [Lazarus] While starting IDE, lazarus lock, without nay error

2015-08-12 Thread Mattias Gaertner
On Wed, 12 Aug 2015 12:11:48 +0300
FreeMan freema...@delphiturkiye.com wrote:

 Hello,
 fpc r 31315  lazarus r49654 qtx64 osx yosemite 10.10.4
 when start IDE on splash screen IDE is lock and no any error.
 this is gdb results. bt after cut via ctrl + c
 has any one any idea?
[...]
 (gdb) bt
 #0  MAKERELATIVEFILELIST (FILES=0x1129053c0, BASEDIR=0x1145a9298 '/') at 
 definetemplates.pas:1240

I don't see how this code can loop endlessly.
Does the problem happen with the release compiler 2.6.4 too?


 #1  0x00010035d7d7 in SAVETOXMLCONFIG (this=0x1143af3a0, 
 XMLCONFIG=0x1143ebc00, PATH=0x1145a1818 'FPCConfigs/Item1/')
  at definetemplates.pas:7815
 #2  0x000100360357 in SAVETOXMLCONFIG (this=0x1057ea2c0, 
 XMLCONFIG=0x1143ebc00, PATH=0x100bf3698 'FPCConfigs/')
  at definetemplates.pas:8270

Mattias

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


Re: [Lazarus] help needed making an ide extension

2015-08-12 Thread Marc Santhoff
On Mi, 2015-08-12 at 23:17 +0200, Mattias Gaertner wrote:
 On Wed, 12 Aug 2015 21:16:22 +0200
 Marc Santhoff m.santh...@web.de wrote:
 
 [...]
  1. Is it correct that to make an extension basically all I have to do is
  write the code that
  - adds a menu entry for starting the code
  - save it as a lazarus package and check register in ide (or the
  like ;)
  and that's the basis for doing something useful?
 
 Yes, see for example examples/exploremenu.

Good example.

I do not fully understand the creation mechanism. I see an extra
register procedure in frmexploremenu.pas that actually sets the menu
entry. I thought a constructor of the extension class would be called.
But since it is a modal form that is done by execution of the menu code.

Instead there is a notify event FormCreate(), where is that one
called? Is it done that way by convention? Did I miss some piece of
documentation?

  2. When I want the user to select a form for the ide expert to work on,
  a list of available forms is needed. Is iterating over all the projects
  files and getting the form of a file the right way to go?
 
 It depends on what you mean with available.
 For example a project can also access the forms of packages.

Available means all forms the user has created in his own lazarus
project. He will want to place components there and forms from foreign
packages are r/o, me thinks. Except when actively working on an opened
package.

Hmm, you're right, not easy to distinguish which is which.

  Additionally if yes:
  
  The code there:
  
  http://wiki.lazarus.freepascal.org/Extending_the_IDE#Get_unit.2C_designer.2C_form_of_a_file
  
  looks OK, but doesn't it open all the files of a project?
 
 It opens all forms of the project.

OK, not what I want. What strategy can be used to get a list of forms in
the users project without having to open them all?

  And does 
  
  // get form
  aForm:=aDesigner.Form;
  
  give NIL if the file has no form?
 
 aDesigner will be nil.

OK.

  3. How do I create a new component on a form?
  For doing so one would need at least a reference to the active form and
  second a reference to the active component to use as parent.
 
 Adding a component can be complex.
 See designer/designer.pp TDesigner.MouseUpOnControl AddComponent.

Uff. Lots of safety belts, some tricky looking code for calculating
bounds, but in general it answers my question.

Seems to be necessary to inform the IDE about changing the form.
 
  Afterwards, will the new component created and have owner, parent and
  essential properties set and then added, like I would do in any other
  program creating components in code at runtime or is there another way
  (sth. like IDEDoCreateComponetntAndAdd(newcomponent.class))?
 
 Maybe such a function can be added to the IDEIntf.

In principle making something like designer/designer.pp
TDesigner.MouseUpOnControl AddComponent publicly available would
suffice.

 Can you give some more details what you are trying to achieve?

I'm only learning how to do basic actions. Playing around, that is.

Currently it is planned to show a list of available forms and let the
user select one. Then he would select the parent component for one or
more new components to insert. All done from a modal form, and if
feasible it will evolve to some sort of multi step wizard or
assistant dialog triggering complex actions.

Many thanks,
Marc

-- 
Marc Santhoff m.santh...@web.de


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


[Lazarus] While starting IDE, lazarus lock, without nay error

2015-08-12 Thread FreeMan

Hello,
fpc r 31315  lazarus r49654 qtx64 osx yosemite 10.10.4
when start IDE on splash screen IDE is lock and no any error.
this is gdb results. bt after cut via ctrl + c
has any one any idea?
..
c FileAge=1439370051 StoredAge=1438857084
Hint: [TFPCTargetConfigCache.NeedsUpdate] /usr/local/bin/fpc 
TargetOS=darwin TargetCPU=x86_64 CompilerOptions= 
ExtraOptions=-Fr/opt/lazarus/components/codetools/fpc.errore.msg 
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/freeman35/.autojump/bin:/sw/bin:/sw/sbin:/Library/Frameworks/Firebird.framework/Resources/bin:/opt/binutils/x86_64-linux/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin
RunTool /usr/local/bin/fpc -iWTOTP -Px86_64 -Tdarwin 
-Fr/opt/lazarus/components/codetools/fpc.errore.msg

[New Thread 0x1843 of process 13864]
RunTool /usr/local/bin/fpc -va -Px86_64 -Tdarwin 
-Fr/opt/lazarus/components/codetools/fpc.errore.msg compilertest.pas

Hint: [TFPCTargetConfigCache.Update] has changed
Hint: [TFPCTargetConfigCache.NeedsUpdate] TargetOS= TargetCPU= 
Options= compiler file changed /usr/local/bin/fpc FileAge=1439370051 
StoredAge=1438857084
Hint: [TFPCTargetConfigCache.NeedsUpdate] /usr/local/bin/fpc TargetOS= 
TargetCPU= CompilerOptions= ExtraOptions= 
PATH=/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/opt/X11/bin:/Users/freeman35/.autojump/bin:/sw/bin:/sw/sbin:/Library/Frameworks/Firebird.framework/Resources/bin:/opt/binutils/x86_64-linux/bin:/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin

RunTool /usr/local/bin/fpc -iWTOTP
RunTool /usr/local/bin/fpc -va compilertest.pas
Hint: [TFPCTargetConfigCache.Update] has changed
Hint: (lazarus) [TBuildManager.SetBuildTarget] Old=x86_64-darwin-qt 
New=x86_64-darwin-qt FPC=True LCL=False

^C
Program received signal SIGINT, Interrupt.
MAKERELATIVEFILELIST (FILES=0x1129053c0, BASEDIR=0x1145a9298 '/') at 
definetemplates.pas:1240

1240  BaseDirLen:=length(BaseDir);
(gdb) bt
#0  MAKERELATIVEFILELIST (FILES=0x1129053c0, BASEDIR=0x1145a9298 '/') at 
definetemplates.pas:1240
#1  0x00010035d7d7 in SAVETOXMLCONFIG (this=0x1143af3a0, 
XMLCONFIG=0x1143ebc00, PATH=0x1145a1818 'FPCConfigs/Item1/')

at definetemplates.pas:7815
#2  0x000100360357 in SAVETOXMLCONFIG (this=0x1057ea2c0, 
XMLCONFIG=0x1143ebc00, PATH=0x100bf3698 'FPCConfigs/')

at definetemplates.pas:8270
#3  0x0001003634e2 in SAVETOXMLCONFIG (this=0x1057ea220, 
XMLCONFIG=0x1143ebc00, PATH=0x0) at definetemplates.pas:8894
#4  0x0001006a47cd in SAVEFPCDEFINESCACHES (this=0x10b748140) at 
buildmanager.pas:1083
#5  0x0001006a3a02 in RESCANCOMPILERDEFINES (this=0x10b748140, 
RESETBUILDTARGET=false, CLEARCACHES=false,

WAITTILLDONE=false, QUIET=true) at buildmanager.pas:949
#6  0x0001006ad883 in SETBUILDTARGET (this=0x10b748140, 
TARGETOS=0x0, TARGETCPU=0x0, LCLWIDGETTYPE=0x0,

SCANFPCSRC=SMSFSBACKGROUND, QUIET=true) at buildmanager.pas:2692
#7  0x0001006adaea in SETBUILDTARGETPROJECT1 (this=0x10b748140, 
QUIET=true, SCANFPCSRC=SMSFSBACKGROUND)

at buildmanager.pas:2708
#8  0x000100090f74 in INITCODETOOLBOSS (this=0x11026f040) at 
main.pp:8697
#9  0x000100072ad8 in CREATE (this=0x11026f040, vmt=0x1, 
THEOWNER=0x105788330) at main.pp:1445

#10 0x00011103 in PASCALMAIN () at lazarus.pp:118
#11 0x000100021ca9 in SYSTEM_$$_FPC_SYSTEMMAIN$LONGINT$PPCHAR$PPCHAR ()
#12 0x in ?? ()
(gdb)

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


[Lazarus] help needed making an ide extension

2015-08-12 Thread Marc Santhoff
Hi,


I'd like to try building an extension to Lazarus. After reading a lot of

 http://wiki.lazarus.freepascal.org/Extending_the_IDE#See_also

I think I'm starting to understand how this can be done. But some
questions are left open:


1. Is it correct that to make an extension basically all I have to do is
write the code that
- adds a menu entry for starting the code
- save it as a lazarus package and check register in ide (or the
like ;)
and that's the basis for doing something useful?


2. When I want the user to select a form for the ide expert to work on,
a list of available forms is needed. Is iterating over all the projects
files and getting the form of a file the right way to go?
Additionally if yes:

The code there:

http://wiki.lazarus.freepascal.org/Extending_the_IDE#Get_unit.2C_designer.2C_form_of_a_file

looks OK, but doesn't it open all the files of a project?
And does 

// get form
aForm:=aDesigner.Form;

give NIL if the file has no form?
 

3. How do I create a new component on a form?
For doing so one would need at least a reference to the active form and
second a reference to the active component to use as parent.

Afterwards, will the new component created and have owner, parent and
essential properties set and then added, like I would do in any other
program creating components in code at runtime or is there another way
(sth. like IDEDoCreateComponetntAndAdd(newcomponent.class))?



If there is an example doing all of this stuff, please point me there.
After browsing some intresting names in lazarus/examples I haven't found
what's missing.

TIA,
Marc

-- 
Marc Santhoff m.santh...@web.de


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