Replies: 6 comments 1 reply
-
|
You can use the |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the info. I actually figured this out late last night after posting this question. Using procedure TMainForm.PropertiesOnChange(Sender: TObject);
var
itemIndex1: Integer;
itemIndex2: Integer;
itemString: String;
begin
itemIndex1 := lstProperties.FocusItem;
itemIndex2 := lstProperties.Items.IndexOf(lstProperties.Text);
itemString := Trim(lstProperties.Text);
// Prints listbox item clicked index
WriteLn(itemIndex1);
WriteLn(itemIndex2);
// Prints listbox item clicked string
WriteLn(itemString);
end;Also wanted to say I managed to get vscode setup for Free Pascal Compiler and with the help of the plugin I started with Lazarus but 6gb really? It also corrupted my keyboards leds every time I compiled anything (never figured out why?) which required a reset to fix. Then I tried MSEIDE but documentation is very limited for it. It also has no Listbox in its widget set and I use Listboxes very often. Managed to imitate one with a string grid but it was far from ideal and yours just works and looks great. Thanks, William |
Beta Was this translation helpful? Give feedback.
-
|
That's fantastic news, and glad you got a fully working environment now. I've never really used VSCode, but now I'm very curious. :-) Any setup tips or configs you can share for a complete first-timer like me? On a side note: I would love if you could give it a try and give some feedback if you don't mind. It's a tool for developers, so I want to make sure I cater for others too - not just my own needs. Compile and open any project.xml file. I'm moving away from the traditional Delphi-style IDE, and "Project Settings" and "Compiler Settings" dialogs, to more auto-discovery and conventions-over-configurations, via the PasBuild build tool (also something I wrote). |
Beta Was this translation helpful? Give feedback.
-
|
Sure I can show you my vscode setup, I'll take a few pics to give you a better idea. I did actually take quick look at Maximus and was very impressed, very clean looking UI. I would rather use it over vscode but you stated it was a work in progress in the readme and I wanted something to use right now. I'll definitely take another in depth look at it again. I built PasBuild from source in order to build fpGUI but I need to actually look deeper into how PasBuild works with using xml files. I very recently decided to pick up Pascal programming again. The last time I used it, Borland's Turbo Pascal was the go to compiler. That tells you how long ago that was, so basically I'm picking this up from scratch again and having fun doing it. I'll go grab a few screenshots and post them with my next post shortly. |
Beta Was this translation helpful? Give feedback.
-
Here is my vscode setup in detail...First I needed to install 2 plugins. FreePascal Toolkit Object Pascal Syntax Highlighter After that opening an fpGUI project will give you a whole lot of errors. This needs to be fixed in the settings like I have below...
They key is to get all the correct paths. Note: The pic is from my settings.json file but vscode has a UI for entering settings. This way I could get them all in one pic. When all needed settings are correct you will now have auto completion for fpGUI in the editor like this...
Setting up tasks.jsonHere is my tasks.json file {
"version": "2.0.0",
"tasks": [
{
"label": "Keyword Help (ctrl+f1)",
"type": "process",
"icon": {
"id": "info",
"color": "terminal.ansiCyan"
},
"command": "/home/william/bin/docview",
"args": [
"/home/william/Documents/programming/Documentation/INF-FPC/fpgui.inf",
"-k",
"${selectedText}"
],
"presentation": {
"reveal": "always",
"close": true
},
"problemMatcher": []
},
{
"label": "Run Executable (alt+r)",
"type": "process",
"icon": {
"id": "run",
"color": "terminal.ansiYellow"
},
"command": "./TfpgLabel",
"presentation": {
"focus": true,
"reveal": "always",
"close": true,
"panel": "new"
},
"problemMatcher": []
},
{
"label": "UI Designer",
"type": "process",
"command": "/home/william/Documents/programming/tools/fpGUI-develop/uidesigner/target/uidesigner",
"presentation": {
"reveal": "always",
"close": true
},
"problemMatcher": []
},
{
"label": "UI Designer `form_main.pas` File (ctrl+u)",
"type": "process",
"icon": {
"id": "build",
"color": "terminal.ansiMagenta"
},
"command": "/home/william/Documents/programming/tools/fpGUI-develop/uidesigner/target/uidesigner",
"args": [
"form_main.pas"
],
"presentation": {
"reveal": "always",
"close": true
},
"problemMatcher": []
},
{
"label": "debug",
"file": "TfpgLabel.lpr",
"type": "fpc",
"group": {
"kind": "build",
"isDefault": false
},
"presentation": {
"showReuseMessage": false,
"clear": true,
"close": true,
"revealProblems": "onProblem"
},
"buildOption": {
"unitOutputDir": "./units",
"customOptions": [
"-dDEBUG",
"-gw2"
]
}
},
{
"label": "release",
"file": "TfpgLabel.lpr",
"type": "fpc",
"group": {
"kind": "build",
"isDefault": true
},
"presentation": {
"showReuseMessage": false,
"clear": true,
"close": true,
"revealProblems": "onProblem"
},
"buildOption": {
"unitOutputDir": "./units",
"customOptions": [
"-dRELEASE",
"-O2"
]
}
}
]
}This will add to the menu Terminal/Run task,,,
To setup hotkeys add to the users Keybindings.json... // Place your key bindings in this file to override the defaults
[
{
"key": "ctrl+f1",
"command": "workbench.action.tasks.runTask",
"args": "Keyword Help (ctrl+f1)"
},
{
"key": "ctrl+u",
"command": "workbench.action.tasks.runTask",
"args": "UI Designer `form_main.pas` File (ctrl+u)"
},
{
"key": "alt+r",
"command": "workbench.action.tasks.runTask",
"args": "Run Executable (alt+r)"
},
]And finally an example project running from vscode...
This example project is just a proof of concept to help me relearn Pascal and to learn how the fpGUI widgets work. The info in the program would probably be better in a help file document, but where is the fun in that. That was a long post lol. I should actually put this all in a markdown file with more detail into all the steps involved. If you have any question, ask away. William |
Beta Was this translation helpful? Give feedback.
-
|
Sorry for not updating this for so long, got sidetracked with other business that needed my attention. I missed out on a whole new release of fpGUI but I compiled it today and everything looks great. I actually had a big list of suggestions/observations for Maximus but I see you updated that as well. You fixed the one crash I was getting in the editor, typing a < would lock up the program but that no longer happens. After a quick look there are still a few things I have noticed. MaximusConfigure IDE Window title displays Project/New (Empty)... - Opens tab empty.pas but errors with... Project/New from template - Lets me pick Menu Run/Run works now and output is sent to a dedicated output window! Thank you. CTRL+z Undo should clear file modified state when start of undo buffer reached (The asterisk in front of the name on the tab. There are no changes at that point) Search find with replace not working, find by itself works ok Search/Procedure List - on file without any procedures errors with... Search/Procedure List - Mouse selection does not work Project Options I had more on my list but I need to test the new version to see if any of those still apply to the new version. PasBuildI was not aware of all the updates you did on this. I was still on v1.2 but I have compiled the current code now. I am really very impressed with this software. It seems very powerful but it is very simple to use. I will be using this moving forward. The asciidoc file format was new to me but I installed extensions in vscode and my browser to view them. The one in the browser looks much nicer! I have updated my Thanks again, William |
Beta Was this translation helpful? Give feedback.




Uh oh!
There was an error while loading. Please reload this page.
-
Is there any method of getting the users selection from a listbox? I have looked through the source in
fpg_listbox.pasand there does not appear to be any function like GetSelectedItem or anything similar. I have tried using OnChange which works fine for the notification but it only sends the Sender TObject and not the the item index of the changed item. I have tried looping through all the items and I can get the text for each item but there also does not seem to be any method for getting the state of the item, selected or not.Any suggestions would be appreciated, Thank you, William
Beta Was this translation helpful? Give feedback.
All reactions