|
Post by Rod on Apr 7, 2023 18:22:42 GMT
I have been expanding my demo of control placement and snap too working. I will go into detail later but the original Freeform always felt a bit cumbersome to me. This code focuses on easy, high precision placement of controls. It does not try to replicate the controls it simply shows the area the controls will occupy. At this early stage I am just looking for feedback on how the control placement behaves. When you select a control from "Add New" it will appear on the form and stay highlighted. While it is highlighted you can move it with the left mouse to position it where you want. You can also expand it with left mouse move. While it is highlighted the properties are displayed on right mouse click and can be amended. So you can edit the name,text and associated resource. While it is highlighted you can press delete, ctrlC and then ctrlV to copy and paste. The controls are given default names, they will be given any name you enter in properties. You can close your work and it will restore. I hope you find the control placement and movement easy and easy to amend. Please give it five minutes play and tell me what you think. This is a link to the latest version
|
|
|
Post by xxgeek on Apr 7, 2023 20:06:52 GMT
Working well here Rod. A lot easier than the old freeform
I like the way you have allowed to move controls off screen as well, please don't change that as you progress.
|
|
|
Post by Rod on Apr 8, 2023 6:20:43 GMT
Well allowing off screen placement was probably a bug but I see how it could be useful. So too allowing one control exactly over the other which is currently a bug but again for textbox color change it could be useful.
I meant to expand on the snap to description. It snaps to the nearest grid point not the least grid point. This makes a big difference in how it appears to work as it can be seen snapping to and you don’t need to pull it past the point you want, just near it. So you don’t have to cover the point you are aiming for.
I also need to make the checkbox and radio button controls more transparent, bit like the static text. Next job is to work out font height and width to set control height when the font changes. I intend to make resizing of text based controls multiples of this height.
However I want to keep it as lean and mean as it can be, very simply focused on control placement.
|
|
|
Post by tsh73 on Apr 8, 2023 9:35:36 GMT
So far so good
resizing with RMB looks unusual but working
Really like DEL CtrlC CtrlV bit
I managed to kill it twice - once then refused to select BMP for BMP button other then tried to CtrlC / CtrlV BMP button (dies on CtrlV)
|
|
|
Post by Rod on Apr 8, 2023 11:21:47 GMT
Thanks, I will look at adding a resizing mark that can be selected with left mouse button. That might allow pop up properties window on right mouse button.
Yeah I was surprised I got bmp buttons working at all. Still lots to do.
One of the concepts I am chasing down is to size the control height correctly for the text height chosen. It can still be enlarged but by default it adopts the text height plus a margin. Using your technique of printing a letter and returning the posxy change to get height and width.
|
|
|
Post by cundo on Apr 8, 2023 20:25:59 GMT
Very nice Rod! Since I'm using a touch pad it took me a while to find how to resize controls, but got it working and I like it
|
|
|
Post by Rod on Apr 9, 2023 6:45:03 GMT
Yeah. Had not thought about touchpads. I will move to left mouse button working. Currently embroiled in font width and height adjustment . So much easier to just force fixed font working but no one would use it if I did that. Planning one project wide font and then dedicated control by control font changes. Think I will limit control placement to the current client area but will do a ctrlH to let it be hidden off screen. I think I will also add a gap when doing ctrlV.
|
|
|
Post by honky on Apr 9, 2023 11:23:31 GMT
Hello Rod, I copy pasted your code in Just Basic v2, I closed without saving. I repasted in a new editor, and surprise, my previous attempts reappear. I searched for "lastsession.ffu" all over the disk without finding it In which directory is the "lastsession.ffu" saved ??
|
|
|
Post by Rod on Apr 9, 2023 16:24:44 GMT
the .ffu is simply saved in the current working directory. So whatever directory you put the ,bas in. DefaultDir$ should be the directory. I don't add a path deliberately as that makes the file much easier to place and find.I have yet to implement new, save as and load. You can simply delete the .ffu to start fresh or delete controls with Del when highlighted.
|
|
|
Post by Rod on Apr 9, 2023 16:29:36 GMT
Still struggling with fonts. I have fixed the leftMousemove to do both move and resize, I have fixed the bmp handling. Here is the latest version, buggy so just stick with the default font. You will need to delete the .ffu file as it has new content.
see later code
|
|
|
Post by Rod on Apr 9, 2023 17:23:16 GMT
The resize may be too precise, you need to click within a grid space of the right edge. I may expand that.
|
|
|
Post by xxgeek on Apr 9, 2023 18:51:53 GMT
the .ffu is simply saved in the current working directory. So whatever directory you put the ,bas in. DefaultDir$ should be the directory. I don't add a path deliberately as that makes the file much easier to place and find.I have yet to implement new, save as and load. You can simply delete the .ffu to start fresh or delete controls with Del when highlighted. Since honky didn't save the code to file, the file would have been saved to the AppData folder. Assuming honky's username is honky on his pc, then the file would be in c:\Users\honky\AppData\Roaming\Just Basic v2.0 Hope this helps anyone who didn't save the code to file to find the file the code created named "lastsession.ffu". If this file is not deleted, it will be used to create the same form every time this code is used. When copy/pasting code to JB IDE it is best to save it to a folder of it's own before Running it. In some cases, code will write many files, create many folders, and cause havoc in your AppData folder.
|
|
|
Post by Rod on Apr 9, 2023 19:25:54 GMT
Yeah, I have not used %appdata% for a long while. I always save and run code in a project directory. So xxgeek’s advice is exactly what I do. It doesn’t help much that Windows now hides the %appdata% folder. This is a change since Carl followed the early advice to use %appdata%
You can still get to the directory if you key %appdata% into explorer but explorer will never list it back to you while browsing. Stupid!
Anyways you can also get to %appdata% by setting preferences to no file and restarting Just BASIC. No wonder I stopped using it!
If you create a directory on a drive called basic and a sub directory called freeformultra you can save .bas files and resources in it li, if in c: it will be c:\basic\freeformultra\freeform.bas and lastsession.ffu will be in there to.
Much much better than all that user directory nonsense. So creating project directories is a habit now snd goodbye %appdata%
|
|
|
Post by tsh73 on Apr 9, 2023 19:28:23 GMT
On the 1280x1024 screen properties window happens to be UNDER main screen So I was not aware it is opened at all (!)
font change works - in a control, and on whole window Should it change control height for some controls?
|
|
|
Post by Rod on Apr 9, 2023 19:38:55 GMT
The latest version has code to place the properties window to the side of the main window but I must have the maths wrong. The failure to resize the control height is the bug I work on. It takes the font change and knows the new height but for some reason the height is getting lost and the control keeps the same height..
The project font change needs to be applied at the start of the project. Change that mid way will require everything to be changed. Might be possible.
As it is set now once a control is created only then can its font and size be changed to something unique
Remains to be seen if these font methods are providing what folks expect. So all and any feedback welcome
What do you want to be able to do?
|
|