下載:
https://sourceforge.net/projects/lazarus/files/
?? ?最新版3.2.2的fpc,3.2的lazarus
?? ?sourceforge默認下載慢,選擇auto-select能夠選擇近的鏡像站點,還不行的話也能夠motrix下載會自動更換域名
linux的qrencode安裝是 sudo apt install qrencode
設置 lazarus
啟動先安裝gif控件,重啟后在wile64控件組里有
?? ?然后軟件包啟用dock相關三個組建,分散式ide變成一體化ide
?? ?工具 選項 :編輯器 顯示 右邊線 從80改為120 字體更新為 dejavu sans mono 這樣中英文在一起等高更好看些
?? ?豆沙綠 RGB值為199, 237, 204,lazarus顯示 顏色把默認文本背景色更新為錢綠
?? ?工具 選項 :環境 對象查看器 背景也更新為 錢綠 不同值背景色 更新為銀白 值更新為紫紅 參考 更新為紫?? ?
?? ??? ??? ?窗體編輯器 網格把黑色改為中灰 其他設計器背景色 更新為 銀白
?? ?給lazarus工程信息文件lpi創建了圖標/usr/share/mime/packages/lazarus.xml
?? ?<generic-icon name="lazarus"/>這一行指定圖標
linux用的圖標主題boom
將文件放到 /usr/share/icons/bloom/mimetypes/48/lazarus.svg
linux下lazarus代碼不能輸入中文,嘗試增加宏定義WITH_GTK2_IM失敗
采用老辦法?https://www.cnblogs.com/qiufeng2014/p/15640889.html
給/usr/share/lazarus/3.2.0/ide/sourceeditor.pp 和?sourceeditor.lfm增加寫權限
procedure InsertKeyword(const AKeyWord: string);procedure TSourceEditor.InsertKeyword(const AKeyWord: string);beginif ReadOnly then Exit;FEditor.InsertTextAtCaret(AKeyWord);end;
procedure TSourceNotebook.FormKeyDown(Sender: TObject; var Key: Word;Shift: TShiftState);var _sIns:String;beginif (ssCtrl in Shift) and (key=13) thenbeginkey:=0;_sIns:=trim(InputBox('輸入待插入中文字符','',''));if _sIns<>'' thenbeginGetActiveSE.InsertKeyword(_sIns);FocusEditor;end;end;end;
然后重新編譯lazarus,如果失敗就用sudo啟動lazarus編譯,如果使用中有破壞了lazarus,清空home下.lazarus,就可以繼續使用,只不過自定義的一堆要重來一遍
新建lazarus項目界面上一個gif控件一個普通控件,一個輸入文本框,一個執行按鈕,一個退出按鈕,界面很簡單,下面是業務代碼備用
unit Unit1;
{$mode objfpc}{$H+}
interface
usesClasses, SysUtils, Forms, Controls, Graphics, Dialogs, StdCtrls, ExtCtrls,GifAnim, Process;
type{ TForm1 }TForm1 = class(TForm)Button1: TButton;Button2: TButton;Edit1: TEdit;GifAnim1: TGifAnim;Image1: TImage;Label1: TLabel;Timer1: TTimer;procedure Button1Click(Sender: TObject);procedure Button2Click(Sender: TObject); procedure Timer1Timer(Sender: TObject);privatepublicend;
varForm1: TForm1;
implementation
{$R *.lfm}
{ TForm1 }
procedure convertimg(Source: string);
varProcess: TProcess;
beginif (length(Source) > 0) thenbeginForm1.label1.Caption := '開始執行了...';Process := TProcess.Create(nil);tryProcess.InheritHandles := False;Process.Options := [];//Process.ShowWindow := swoShow;Process.Executable := 'qrencode';Process.Parameters.Add('-l');Process.Parameters.Add('L');Process.Parameters.Add('-v');Process.Parameters.Add('1');Process.Parameters.Add('-s');Process.Parameters.Add('11');Process.Parameters.Add('-o');Process.Parameters.Add('output.png');Process.Parameters.Add(Source);Process.Execute;Form1.label1.Caption := '已經執行了';excepton E: EOSError doForm1.label1.Caption := '請檢查文件路徑是否有空格';end;Process.Free;end;
end;
procedure TForm1.Button1Click(Sender: TObject);
beginClose();
end;procedure TForm1.Button2Click(Sender: TObject);
beginGifAnim1.FileName := 'loading.gif';GifAnim1.Visible := True;convertimg(Edit1.Text);Timer1.Enabled := True;
end;procedure TForm1.Timer1Timer(Sender: TObject);
beginTimer1.Enabled := False;if FileExists('output.png') thenimage1.Picture.LoadFromFile('output.png');GifAnim1.Visible := False;
end;end.