Recent

Author Topic: My new unfinished DB admin app in Lazarus  (Read 14788 times)

Fantablup

  • Full Member
  • ***
  • Posts: 169
Re: My new unfinished DB admin app in Lazarus
« Reply #15 on: July 09, 2021, 09:20:09 pm »
Starting to work on the text blob.
Not yet added save to button.

Actually, I realized, when creating a custom header, it will be possible to add special sorting possibilities. So, a custom header is just good.

Also have to add the check for base64 images, so it is not seen as text blobs, to show as images too. some saves all images as base64, and not as binaries.

Also in the todo list is:
Make it use less memory. Destroy all the images from first row to last row between 100 rows from the current row. And when scrolling to these rows again, it re-load the image from the DB.
Or do this by checking stream size of images instead of row numbers. That will be more exact.
If i,m not doing this, the grid will just eat memory.
« Last Edit: July 09, 2021, 10:23:09 pm by Fantablup »

Fantablup

  • Full Member
  • ***
  • Posts: 169
Re: My new unfinished DB admin app in Lazarus
« Reply #16 on: July 10, 2021, 09:06:27 pm »
I realized that i also need to implement max rows in the grid.
That's because of memory.
Can' just add 1000+ or million rows at ones.
Need to keep it at max rows that the grid component sets.
It helps with talking in this forum. It gives new stuff to think of.

I also realized that deleterows is public in Lazarus, but not in Delphi. Not sure yet, but i read it.

So, allot of work is going to be done in the new grid component. Much more than i excpected.

Fantablup

  • Full Member
  • ***
  • Posts: 169
Re: My new unfinished DB admin app in Lazarus
« Reply #17 on: July 14, 2021, 11:31:33 pm »
I finally got the result list to work good.
I have created a custom List header, and also worked on getting all items in the correct cells.

Now, these small buttons is not painting over the lits header either.

This has been some hard work indeed.
I am also making this custom DBGrid component work with any db component with just connecting to a TDataSource., So it will not only work with Zeos.

The only thing left to do on the grid is a new sorting function, and functions for keeping memory use low in the list. These two things is also allot of work.

440bx

  • Hero Member
  • *****
  • Posts: 3944
Re: My new unfinished DB admin app in Lazarus
« Reply #18 on: July 14, 2021, 11:35:01 pm »
It's looking good :)
(FPC v3.0.4 and Lazarus 1.8.2) or (FPC v3.2.2 and Lazarus v3.2) on Windows 7 SP1 64bit.

egsuh

  • Hero Member
  • *****
  • Posts: 1273
Re: My new unfinished DB admin app in Lazarus
« Reply #19 on: July 15, 2021, 12:43:27 am »
Quote
I have re-programmed it for the web with Javascript and Node js, and it is completed. I used 4 years on it. It run on any OS and the web.
I'm planning to replace the Node js with a web server i create in Lazarus, for the desktop version.

Theoretically web server can be written in eigher  Lazarus  or node.js, and client can be either of webbrowser or desktop application, and they can cross-access. Do you have any specific reason to rewrite web server as well, in addition to desktop application?

Fantablup

  • Full Member
  • ***
  • Posts: 169
Re: My new unfinished DB admin app in Lazarus
« Reply #20 on: July 15, 2021, 01:17:27 am »
A good reason.
Size.

The node js is big when adding it as a web server for the desktop app. Over 100 mb.
Writing it in pascal will reduce the size of the web server.

Fantablup

  • Full Member
  • ***
  • Posts: 169
Re: My new unfinished DB admin app in Lazarus
« Reply #21 on: July 15, 2021, 10:18:40 pm »
I have implemented sorting on columns. It can now sort on numbers and text.
And also implemented padding on rows. Here you see on the images that it is space between top and bottom.
I will give this custom DBGrid out for free, and with source when finished. It should also be compatible with Delphi, but i don't know, and don't wanna try it there. Have to install the community version since it has some earning money requirements after install.

But it is some work until it is ready.

Fantablup

  • Full Member
  • ***
  • Posts: 169
Re: My new unfinished DB admin app in Lazarus
« Reply #22 on: July 16, 2021, 12:47:01 am »
I just added cellpadding in the grid.
If you open the cellpadding property, you can select padding for all sides.
This is a very nice feature. Like the flex in CSS.

I also see that i can make the grid responsive like the flex grid in CSS.
When the space for the columns is too small, the rest of the columns drops down a row, and also show the column header text. Just like flex in CSS.
This is something i have wanted all the time i have developed in Delphi and Lazarus.

I will give it a try implementing this.
« Last Edit: July 16, 2021, 01:07:03 am by Fantablup »

Fantablup

  • Full Member
  • ***
  • Posts: 169
Re: My new unfinished DB admin app in Lazarus
« Reply #23 on: July 16, 2021, 06:27:30 am »
Now the grid is also auto resizing the row by the height of the images.
And cell paddings is working good.
Here it is a little wrong on the stwo last one, because it should have the delete button, and therefor larger height on the rows.
I have added Editable property on the grid, and if it is set editable, it have a larger row height and shows all buttons. If not, it auto resize to the image, and the row height is smaller.

I want to create this component as nice as possible, because it is more nice to work with it when finished, and the user don't need to program these things manually for the grid.
But it is allot of work on it though.
« Last Edit: July 16, 2021, 06:51:27 am by Fantablup »

Fantablup

  • Full Member
  • ***
  • Posts: 169
Re: My new unfinished DB admin app in Lazarus
« Reply #24 on: July 18, 2021, 12:05:32 am »
I created a simple video demo on the SQL editor.
It only shows how smooth the scrolling are, and that it loads data little by little. Even if it is a end-user defined SQL.
https://www.youtube.com/watch?v=Ud5eLTfTILE&ab_channel=ViggoJamne

Fantablup

  • Full Member
  • ***
  • Posts: 169
Re: My new unfinished DB admin app in Lazarus
« Reply #25 on: July 19, 2021, 03:23:05 am »
I have now re-done how the grid add the images and buttons. Adding components to the cells used way too much memory, and it crashed if it used too much.
I have removed all components like TImage and TPicture.
It only draw visually from a TImageList instead in each cell.

Now, the grid is only using a little tbitmap. It only draws all the rest and the tbitmap on the canvas. It only checks where the user is clicking, and execute the stuff instead of having real buttons.
The grid is now working very good, and using normal memory.
It also keeps only the 50 images from the top row, and frees the images before this.
It does the some with images below the visible results.
So, only 50 small images from the beginning and only 50 images after the visible list. With thousand of lines it will not have more images at any time.

The image is a tiny bitmap that is resized from the bigger image, and is in one array.

Clicking the images loads the original image from the database, and shows it in a bigger widow.

This way, i can keep the memory use very low, and just use one tiny bitmap, and one small array for the row and col.

But it has been allot of thinking and trying. Not done easily.
I also created two extra functions that i just call when drawing items to the cells using only X and Y position in rect and size i want it to be, and it automatically draws it and resize it.
It's working very well, and fast too.


« Last Edit: July 19, 2021, 01:20:28 pm by Fantablup »

valdir.marcos

  • Hero Member
  • *****
  • Posts: 1106
Re: My new unfinished DB admin app in Lazarus
« Reply #26 on: July 19, 2021, 11:39:36 pm »
Thanks guys.

I,m not sure about opensource it. Because i have never earned a dime on all my free programs.
I had a free invoice system made in Delphi, and over 1000 company used it, but only got some small unuseful shit in the mail as thanks from some of them. It could be a small ice fishing kit that cost 5 bucks.


I stopped developing it, and removed it from web after over 10 years.
I have re-programmed it for the web with Javascript and Node js, and it is completed. I used 4 years on it. It run on any OS and the web.
I'm planning to replace the Node js with a web server i create in Lazarus, for the desktop version.
But right now i'm developing this DB admin app in Lazarus.

So, i'm not sure of opensource. I need to earn money.
@Martin_fr
I don't have anything against paid products.
This topic smells only as a click bait and propaganda of a future paid product.
So, I think this topic should be moved to "Third party" section (Third party announcements).
Thanks.

Fantablup

  • Full Member
  • ***
  • Posts: 169
Re: My new unfinished DB admin app in Lazarus
« Reply #27 on: July 20, 2021, 12:06:36 am »
Sorry for if it seems that way.
Not my intention.
Place it where you want. I don't care about that.

I'm just honest about what i do.
Just trying to show the progress of the grid. And also answering questions.

Maybe it's better to only show progress on the grid instead. It's only that it is now only working in the app.

Well, i'm just honest about what i do. All i can say.
« Last Edit: July 20, 2021, 12:16:50 am by Fantablup »

 

TinyPortal © 2005-2018