Re: [Lazarus] Adding functionality to a control
On 14-06-05 01:50 PM, Mattias Gaertner wrote: On Thu, 05 Jun 2014 12:45:54 -0400 Timothy Groves the.tail.kin...@gmail.com wrote: Hi! I want to add some features to TMemo. Unfortunately, I am still weak on Lazarus. Is there a decent tutorial on extending the functionality of a control? In particular, I want to add some (limited) formatting colour and line numbers, so I need to override whatever method is used to actually display the text. (I can't even figure out what method that is...) This is not supported by TMemo. You can use TSynEdit instead. TMemo offers soft word wrapping. As far as I can tell through Google searches, this is not possible in TSynEdit. So is there a control somewhere that has both, and doesn't require that I use Rich Text or HTML? If not, can you point me towards a decent tutorial on extending the functionality of an existing control? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Adding functionality to a control
Hi! I want to add some features to TMemo. Unfortunately, I am still weak on Lazarus. Is there a decent tutorial on extending the functionality of a control? In particular, I want to add some (limited) formatting colour and line numbers, so I need to override whatever method is used to actually display the text. (I can't even figure out what method that is...) -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Scroll Wheel
On 14-04-11 03:21 PM, Howard Page-Clark wrote: On 11/04/2014 19:33, Timothy Groves wrote: No; I am unsure as to how to do that. Would I need to create a descendant class, or does Lazarus support overriding without doing so? The following should give you an idea how to develop the hint Mattias gave: OK, I'll hang onto that in case I need it, but for the tiny little applet I wrote, that's too much effort; it would double the source length easily. :) Thanks. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Scroll Wheel
I have several TEdit objects in my form, and because they handle only integer data, I'd like to use my scroll wheel to edit their values. However, there is no OnScrollWheel event that I can see. Since scroll wheels are passed as mouse clicks, I thought to examine the OnMouseDown/OnMouseUp events, but nothing is passed to indicate /which/ button is being pressed. So either Google has failed me, or I have failed Google, but either way, I can't find the answer on the net after an hour of searching. Can anyone point me in the right direction? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Scroll Wheel
No; I am unsure as to how to do that. Would I need to create a descendant class, or does Lazarus support overriding without doing so? Chess is an exciting game, when played with shotguns. --MegaHAL On Apr 11, 2014 1:59 PM, Mattias Gaertner nc-gaert...@netcologne.de wrote: On Fri, 11 Apr 2014 13:45:41 -0400 Timothy Groves the.tail.kin...@gmail.com wrote: I have several TEdit objects in my form, and because they handle only integer data, I'd like to use my scroll wheel to edit their values. However, there is no OnScrollWheel event that I can see. Since scroll wheels are passed as mouse clicks, I thought to examine the OnMouseDown/OnMouseUp events, but nothing is passed to indicate /which/ button is being pressed. So either Google has failed me, or I have failed Google, but either way, I can't find the answer on the net after an hour of searching. Can anyone point me in the right direction? Have you tried to override procedure WMMouseWheel(var Message: TLMMouseEvent); message LM_MOUSEWHEEL; ? Mattias -- ___ 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
[Lazarus] Find Form instance with Title
Google has failed me on this one. :( I need to check to see if a dynamically created form (object) with a given title already exists within the application, and if so, to raise it to the front. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Find Form instance with Title
On 13-11-15 11:13 PM, K. P. wrote: Look at your Screen object: http://lazarus-ccr.sourceforge.net/docs/lcl/forms/tscreen.html Check out FindForm and Forms Date: Fri, 15 Nov 2013 22:32:37 -0500 From: the.tail.kin...@gmail.com To: lazarus@lists.lazarus.freepascal.org Subject: [Lazarus] Find Form instance with Title Google has failed me on this one. :( I need to check to see if a dynamically created form (object) with a given title already exists within the application, and if so, to raise it to the front. Thanks for the steer! In case anyone cares, here's how I implemented this: procedure TfrmVolume.lstVolumesDblClick (Sender : TObject ); var NewStoryForm : TfrmStory; FormCaption : string; index : integer; Present : boolean; begin FormCaption := 'Volume ' + Volumes.Current.VolumeName + ''; // The caption I want to search for/create. index := 0; Present := false; repeat if (Screen.Forms [index].Caption = FormCaption) then Present := true else index += 1; until (Present or (index = Screen.FormCount)); if (Present) then Screen.Forms [index].BringToFront else begin NewStoryForm := TfrmStory.Create (Application); NewStoryForm.Caption := FormCaption; NewStoryForm.Show; end; end; -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Multiple copies of same form
I would like to write an app that has the following properties: 1) A main form exists, one of which is spawned at program start; 2) Additional copies of the main form may be spawned; 3) The program exits only when no copies of the main form are in existence. I've tried a few things when spawning additional forms, such as form.Create, but when I close the *first* form spawned, *all* such forms are destroyed. I also tried Application.CreateForm, but that doesn't seem to do anything. Google has failed me, as well. What's my best option for this? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Freetype-6.dll not found
On 13-08-07 03:03 PM, waldo kitty wrote: possibly that but the different name probably was more of the culprit... you didn't say that you had renamed it in the dll path, though... but then, what else would break if it was renamed? as i suggested before, i think you need, in code, to determine what OS you are running on and then attempt to load the dll with the proper name for that OS... apparently it has one name on *nix and another on winwhatever ;) But I did not have to rename zlib1, though I did have to copy it into thew same directory as my executable. Aside from which, I don't need to load a DLL in Linux at all, but an .so file, and the compiler handles that for me. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Freetype-6.dll not found
On 13-08-05 12:47 PM, Edilson Vieira wrote: Check if freetype-6.dll is in same dir as the executable or in windows dir. Fixed it. I had to copy freetype6.dll to the executable's directory, and then rename it to freetype-6.dll. Then copy zlib1.dll into the executable directory as well. Apparently, having them in the Windows DLL search path wasn't good enough. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Freetype-6.dll not found
I have written a program that uses ftfont, and it works fantastically on Linux, but fails to start under Windoze with the above error message. I have installed the FreeType package, and restarted the computer, and still nothing. Any suggestions? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Changing font colour
So I've got a program that saves a graphic image, and I copied chunks of it from http://wiki.freepascal.org/fcl-image because I'm new at this. However, whenever I draw text, it comes out in black, and I wish to be able to change the colour. I've hunted online and through the source code, and nothing seems to work. Can someone tell me what I'm doing wrong? Image := TFPMemoryImage.Create (1025,513); Image.UsePalette := FALSE; Canvas := TFPImageCanvas.Create (Image); FontMgr.SearchPath:='/usr/share/fonts/truetype/ttf-dejavu/'; AFont := TFreeTypeFont.Create; Canvas.brush.FPCOlor := colWhite; Canvas.pen.FPColor := colWhite; Canvas.Font := aFont; Canvas.Font.Name := 'DejaVuSerif'; Canvas.Font.Size := 6 + ZoomFactor; -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Changing font colour
On 13-08-03 07:34 AM, Mattias Gaertner wrote: Have you tried changing Canvas.Font.Color? By trying stuff at random, I managed to figure it out...I changed aFont.FPColor. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Procedural variables as methods
OK, so I solved the problem of assigning a function to a procedural variable (the problem was that I was stupid). But now I can't call it. When I attempt to do so, it gives me: ghistory.pas(260,19) Error: Incompatible types: got tLanguage.procedure variable type of function:AnsiString;Register expected AnsiString Is there something I have to add to the call to make it work? Some code follows. (in tLanguage method) MaleName := @SaxonMale; FemaleName := @SaxonFemale; ClanName := @SaxonFamily; PlaceName := @SaxonPlace; (in main code) Language := tLanguage.Create; a := Language.ClanName; -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Procedure variables
Okay, I've spent an hour googling this one, and got no information that helps. I want to declare four methods as being procedural variables, so that I can set them and call them. Code follows. When I try to compile this, I get: glanguage.pas(37,20) Error: Incompatible types: got address of function:AnsiString;Register expected tLanguage.procedure variable type of procedure;Register. What am I doing wrong? unit glanguage; {$mode objfpc}{$H+} interface uses Classes, SysUtils; type tLanguage = class (tObject) private t_ClanNames : array of string; t_language : integer; procedure SetLanguage (a : integer); public FirstName : procedure; LastName : procedure; ClanName : procedure; PlaceName : procedure; property Language : integer read t_language write SetLanguage; end; implementation uses wrdsaxon; const LG_NONE = 0; LG_SAXON = 1; procedure tLanguage.SetLanguage (a : integer); begin case a of LG_SAXON : begin FirstName := @SaxonMale; LastName := @SaxonFemale; ClanName := @SaxonFamily; PlaceName := @SaxonPlace; end; end; end; end. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Procedure Variables
No, wait, I'm stupid. The procedures I'm assigning to methods are in fact *functions.* Compiles clean now. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Editor component
I need an editor component with two features: Undo and word wrapping. SynEdit/SynMemo do not support word wrapping. Memo does not support undo. What is my best option? -- Cows fly like clouds, but are never quite successful. --Megahal -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Editor component
Undo is unsupported in Tmemo. On 2013-03-08 10:04 AM, Avishai avishai.g...@gmail.com wrote: Try Memo1.Undo On Fri, Mar 8, 2013 at 5:02 PM, Martin laza...@mfriebe.de wrote: On 08/03/2013 14:57, Timothy Groves wrote: I need an editor component with two features: Undo and word wrapping. SynEdit/SynMemo do not support word wrapping. Memo does not support undo. What is my best option? There is a port of the original SynEdit in version 2.0.x (See the wiki about SynEdit) There may (don't know) be word wrap for that. Though it would still be monospaced fonts only. Also I have not used it, and I do not know, how easy/hard it is to install it (potential name conflicts) -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus -- Shalom, Avishai avishai.g...@gmail.com אבישי גוֹר -- ___ 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
[Lazarus] Exception when re-opening a modal dialogue
So when I call TfrmNewChapter.ShowModal, it works the first time. But when I call it the second time, I get an exception. The form is closed with the OK or Cancel buttons; their methods are given below. What am I doing wrong? procedure TfrmNewChapter.btnCancelClick(Sender: TObject); begin txtChapterTitle.Text := ''; frmNewChapter.Hide; end; procedure TfrmNewChapter.btnOKClick(Sender: TObject); var s : string; begin if (txtChapterTitle.Text '') then begin NewChapter (txtChapterTitle.Text); txtChapterTitle.Text := ''; str (ChapterCount, s); while (length (s) 4) do s := '0' + s; Chapter^.Filename := Story^.ShortName + s; PopulateChapterList; frmNewChapter.Hide; MarkChapterListDirty; end; end; -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] IDE
The IDE just seems to get buggier and buggier the longer I use it. Can't click on the tabs in the editor, and if I use F10 to select a tab manually, the edit focus stays on the old page. Is anything being done to fix this? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] IDE
On 13-01-21 12:49 PM, Juha Manninen wrote: On Mon, Jan 21, 2013 at 7:44 PM, Timothy Groves the.tail.kin...@gmail.com wrote: The IDE just seems to get buggier and buggier the longer I use it. Can't click on the tabs in the editor, and if I use F10 to select a tab manually, the edit focus stays on the old page. Is anything being done to fix this? No, because others don't have such problems. The problem must be in your system. You did not mention your OS nor your Lazarus version. It is difficult to say more about the possible reasons. Juha Lazarus 0.9.30.2-2 on XUbuntu 12.04-1 running KDE 4. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] IDE
On 13-01-21 01:21 PM, Mattias Gaertner wrote: Can you try Lazarus 1.0.4? Lazarus 1.0.4 is not yet in the debian repositories. I see that sourceforge has a more recent version available as a deb file, but I have had difficulty with these in the past. I will give it a try. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] IDE
On 13-01-21 01:55 PM, Marc Hanisch wrote: I had the same experience on Ubuntu 12.10. Installing the .deb from Sourceforge was easy and solved the problem. Well, installing the deb from Sourceforge was far from easy, but it seems to have done the trick. Thanks to all who helped, and sorry about the initial post; I was *very* frustrated. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Suppressing OnChange
Thanks to both responders. I actually found another solution: procedure TfrmMain.txtVolAuthorChange(Sender: TObject); begin if (txtVolAuthor.Enabled) then VolumeList [CurrentVolume].Author := txtVolAuthor.Text; end; Then I just set txtVolAuthor.Enabled := false before manually updating it. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Suppressing OnChange
I have a program which allows you to edit records. This is done using a dynamic array of records, with three strings in each record. I have been using TEdits to allow the user to edit the records. The record is updated during TEdit.OnChange. Unfortunately, whenever I push the data *from* a selected record *to* the form, TEdit.OnChange triggers, which tends to corrupt my data. I tried disabling the TEdit, using TEdit.Enabled := false, but the event still triggers. Any suggestions? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] TListBox.AddItem doesn't exist?
So I am trying to add a TListBox to my program. Relevant code is below. TfrmFicMake = class(TForm) . . . lstVolumeList: TListBox; . . . end; procedure TfrmFicMake.btnAddVolumeClick(Sender: TObject); var index : integer; begin frmCreateVolume.ShowModal; lstVolumeList.Clear; for index := 0 to (Length (Volumes) - 1) do lstVolumeList.AddItem (Volumes [index].VolumeName); end; When I try to compile this, I get: mainform.pas(55,18) Error: identifier idents no member AddItem Now, I am almost certain, based on having perused the documentation, that TListBox contains a method called AddItem. What am I doing wrong? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TListBox.AddItem doesn't exist?
Further update: TListBox and TCustomListBox do not, in their source code, list any AddItem method. The documentation states that TCustomListBox is the earliest ancestor with the AddItem method. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TListBox.AddItem doesn't exist?
On 12-10-21 11:01 AM, John Landmesser wrote: Thanks for the help. In retrospect, the error I made was obvious. :( -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Main menu disappeared
I am working on a project, and decided for the first time ever to use a main menu. I set it up, it worked, and then it vanished. It is still present in the IDE and source code, but it no longer appears when the app is run. This happened after I added a ButtonPanel (which I then removed) and two Bitmap Buttons (which are still there). -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] Main menu disappeared
On 12-06-20 01:56 PM, Howard Page-Clark wrote: On 20/6/12 5:50, Timothy Groves wrote: I am working on a project, and decided for the first time ever to use a main menu. I set it up, it worked, and then it vanished. It is still present in the IDE and source code, but it no longer appears when the app is run. You could check that the menuItems' Visible properties are all True. Else post your form.pas and form.lfm here and others may notice something amiss. What Lazarus version and what OS do you compile for? unit imain; {$mode objfpc}{$H+} interface uses Classes, SysUtils, FileUtil, Forms, Controls, Graphics, Dialogs, ComCtrls, Menus, StdCtrls, Buttons, iabout; type { TfrmMainWindow } TfrmMainWindow = class(TForm) btnNewStory: TBitBtn; btnRemoveStory: TBitBtn; Label1: TLabel; lstStories: TListBox; MainMenu: TMainMenu; mnuHelpAbout: TMenuItem; mnuHelp: TMenuItem; mnuEdit: TMenuItem; mnuEditProfiles: TMenuItem; mnuFileExit: TMenuItem; mnuFileSettings: TMenuItem; mnuFile: TMenuItem; procedure mnuFileExitClick(Sender: TObject); procedure mnuHelpAboutClick(Sender: TObject); private { private declarations } public { public declarations } end; var frmMainWindow: TfrmMainWindow; implementation {$R *.lfm} { TfrmMainWindow } procedure TfrmMainWindow.mnuHelpAboutClick(Sender: TObject); begin frmAboutBox.Show; end; procedure TfrmMainWindow.mnuFileExitClick(Sender: TObject); begin frmMainWindow.Close; end; end. object frmMainWindow: TfrmMainWindow Left = 508 Height = 450 Top = 274 Width = 780 BorderStyle = bsDialog Caption = 'FicMake 1.0.0' ClientHeight = 423 ClientWidth = 780 Menu = MainMenu LCLVersion = '0.9.30.2' object Label1: TLabel Left = 8 Height = 20 Top = 16 Width = 74 Caption = 'Story List' ParentColor = False end object lstStories: TListBox Left = 4 Height = 376 Top = 41 Width = 259 ItemHeight = 0 ScrollWidth = 257 TabOrder = 0 TopIndex = -1 end object btnNewStory: TBitBtn Left = 200 Height = 28 Top = 8 Width = 28 Glyph.Data = { 3604424D36043600280010001100 200464006400FF00 FF00FF00FF00FF00FF80004000800080008000800080 0040FF00FF00FF00FF00FF00FF00FF00 FF00FF00FF00FF00FF800080009F00FF009F00FF0080 0080FF00FF00FF00FF00FF00FF00FF00 FF00FF00FF00FF00FF80008000BF00FF00BF00FF0080 0080FF00FF00FF00FF00FF00FF00FF00 FF00FF00FF00FF00FF80008000BF00FF00BF00FF0080 0080FF00FF00FF00FF00FF00FF00FF00 FF00FF00FF00FF00FF80008000BF00FF00BF00FF0080 0080FF00FF00FF00FF00FF00FF00FF00 FF00FF00FF00FF00FF80008000BF00FF00BF00FF0080 0080FF00FF00FF00FF00FF00FF8000400080 008000800080008000800080008000800080008000C000BF00FF00BF00FF0080 00C000800080008000800080008000800080008000800080004000800080009F 00FF00BF00FF00BF00FF00BF00FF00BF00FF00BF00FF00DF00FF00DF00FF00BF 00FF00BF00FF00BF00FF00BF00FF00BF00FF009F00FF0080008000800080009F 00FF00BF00FF00BF00FF00BF00FF00BF00FF00BF00FF00DF00FF00DF00FF00BF 00FF00BF00FF00BF00FF00BF00FF00BF00FF009F00FF00800080008000400080 008000800080008000800080008000800080008000C000BF00FF00BF00FF0080 00C0008000800080008000800080008000800080008000800040FF00 FF00FF00FF00FF00FF80008000BF00FF00BF00FF0080 0080FF00FF00FF00FF00FF00FF00FF00 FF00FF00FF00FF00FF80008000BF00FF00BF00FF0080 0080FF00FF00FF00FF00FF00FF00FF00 FF00FF00FF00FF00FF80008000BF00FF00BF00FF0080 0080FF00FF00FF00FF00FF00FF00FF00 FF00FF00FF00FF00FF80008000BF00FF00BF00FF0080 0080FF00FF00FF00FF00FF00FF00FF00 FF00FF00FF00FF00FF800080009F00FF009F00FF0080 0080FF00FF00FF00FF00FF00FF00FF00 FF00FF00FF00FF00FF80004000800080008000800080 0040FF00FF00FF00FF00FF00FF00 } TabOrder = 1 end object btnRemoveStory: TBitBtn Left = 232 Height = 28 Top = 8 Width = 28 Glyph.Data = { 3604424D36043600280010001100 200464006400FF00 FF00FF00FF00FF00FF00FF00FF00FF00
Re: [Lazarus] Main menu disappeared
On 12-06-20 02:50 PM, Mattias Gaertner wrote: Maybe you accidentally set the form's borderstyle to bsDialog. Set it to bsSizeable. That was it, thanks. I wanted a non-resizeable border, but bsSingle will work just as well. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] How to close a window from code
I've googled this, and I've hunted through the documentation, and I cannot find an answer. I have an app that I'm working on, the graphics portion of which largely just seeds what used to be a console app. I want it so that when the 'Go' button is clicked, the window closes once the main program is complete. How do I code this? -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to close a window from code
On 12-02-01 12:14 PM, Mattias Gaertner wrote: Do you mean a LCL form? Form1.Close; Well, I tried just Close from within a method of the form in question, and that didn't work. This did. Any explanation as to why? (Perhaps the fact that close is also a Pascal reserved word?) -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] How to close a window from code
On 12-02-01 12:37 PM, Mattias Gaertner wrote: Did you get a compiler error? No. The program merely hung upon reaching the Close. This works too: procedure TForm1.Button1Click(Sender: TObject); begin Close; end; This did not work for me. However, the Form1.Close version did, and that's what I'm using. Thanks! -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
Re: [Lazarus] TPageControl suddenly stopped working
On 12/03/2011 07:32 AM, Marcos Douglas wrote: On Sat, Dec 3, 2011 at 9:15 AM, Tail Kinkerthe.tail.kin...@gmail.com wrote: I am working on a project that has two TPageControl instances. One is embedded inside a TTabSheet of another. It is the embedded one that for whatever stupid reason has stopped working. This behaviour started after I set one of the TTabSheets in the TPageControl disabled, but did not cease after I re-set the TTabSheet back to enabled. Can anyone think what might be causing this behaviour? What OS and Lazarus version? I use the same and I don't have this problem. Lazarus 0.9.30 on LUbuntu 11.10. For the most part, I haven't had any such problems. That's why it's such a head scratcher this time. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus
[Lazarus] Changing a TLabel.Caption
I tried changing a TLabel.Caption property, and got a SIGSEGV. Here's the offending code: if (cmbProfileMeasures.Text = 'Inches') then begin labPDFWidth.Caption := 'in X'; labPDFHeight.Caption := 'in'; end else if (cmbProfileMeasures.Text = 'Points') then begin labPDFWidth.Caption := 'pt X'; labPDFHeight.Caption := 'pt X'; end else begin labPDFWidth.Caption := 'cm X'; labPDFHeight.Caption := 'cm X'; end; I am using Lazarus 0.9.30-2build1 on LUbuntu 11.10. -- ___ Lazarus mailing list Lazarus@lists.lazarus.freepascal.org http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus