Topic: Image Gallery

good.
I have a system created in harbor in which I use an article selection screen with images of the same that are generated in different tabs according to the number of families (of articles) there are.
Beforehand I don't know how many families there are or which ones they are.
I attach an image of the result.
Translated from Spanish by google translator

Post's attachments

Attachment icon Screenshot_1.png 175.56 kb, 65 downloads since 2022-02-01 

Re: Image Gallery

Hi,
So what exactly is it that you want to do?
Can you describe your requirement in more detail or, if you have already tried to create something in MyVisualDatabase, upload it so the problem is clearer?
(to upload a project, zip the project folder (without the .exe file).
Derek.

Re: Image Gallery

Hi Derek.
I haven't created anything with Myvisualdatabase yet as I don't know how to do it.
I need to create by code as many image controls as there are records in my database.
For example, if I have 10 articles in my database, I need to generate 10 image controls. If I have 30, I have to create 30. But I don't know this in advance, so I have to do it by script.
Thank you very much in advance for your answer.
Greetings.
(translated from Spanish with google translate)

Re: Image Gallery

Hi,
Usually with any database product, you would have one image per record.
If you want the sort of 'article selection screen' as shown in your attached image, one way would be to deliberately de-normalise your data and hold multiple articles with images against one record (in the attached example, I have 5 articles held as one record.
To create new articles, you can amend an existing record (if there are less than 5 articles in it) or create a new record which will then be able to hold up to 5 new articles and so on.  In this way, you can add an unlimited number of articles without knowing in advance how many you need.
I'm not sure if this is the sort of thing you're trying to create but in the attached example,
1.  you select from a drop down menu (combobox1) to display categories of 'starters', 'main courses' etc.
2.  to change any of the articles, double click it - then you can change its description, its price etc.
3.  to create a new order, click on the new order button and a new order number is allocated.  Then:
3a.  single click on an article in tablegrid1 and then single click in the orders grid (tablegrid2) to add it to that order
3b.  repeat for as many articles as you want to add to the order
3c.  right click on any article in the order tablegrid to either delete it or to change its description or price (this gives flexibility to amend the standard descriptions and price for whatever reason).
3d.  optionally you can print a receipt.
4.  To retrieve an existing order, select it from the drop down menu (combobox2).
Please bear in mind this is just a rough example to show you one of the ways you could write your application using MyVisualDatabase.
I hope this gives you some ideas for your project.
Derek.

Post's attachments

Attachment icon fastfood2.zip 1.48 mb, 188 downloads since 2022-02-10 

Re: Image Gallery

Hi Derek, it's not exactly what I'm looking for, but looking at your example I can find a solution.
One last query. Is it possible to add a control to a form through script (code)? Or is it only possible with the form designer?
If the first option is not possible, perhaps you can create the controls at design time and show or hide them according to the items table.

Thank you very much Derek, if I manage to fix this I will probably switch to MyVisualdataBase, I was impressed with how simple it is.

Translated into English with Google Translate

Re: Image Gallery

Hello,
Anything you can do with the form designer can also be done by writing code (script)..
Derek.

Re: Image Gallery

Hi Derek,
Cool.
Could you spend an example of how to add a button via code?
Thanks a lot

Translated from Spanish with Google translator

Re: Image Gallery

Sorry if this is off-topic a little, but I'm curious...

softjom wrote:

I will probably switch to MyVisualdataBase

If you don't mind sharing, what will you be switching from?

"Energy and persistence conquer all things."

Re: Image Gallery

Hi Softjom, Joshua,
Joshua,
I believe the language that Softjom uses is 'Harbour' (search for harbour programming language) which looks like some sort of derivative / development of Clipper (for those of us with long memories!!).
Softjom,
In the attachment (Softjom1) is an example of creating your own components (in this example, buttons).  However, it is not usually how people use MyVisualDatabase (except perhaps when you want to create a chart or graph). 
Normally, you would use the standard features of MyVisualDatabase to add components and then alter the properties of those components to do whatever you want by using a script. 
For example, to hide or display components, use standard MVD to create the components on your form and then simply alter whether they are visible or not using a script (or 'role based' authorisations (or a combination of the two, depending on how you want your application to work)).
In the attachment (Softjom2), you can see how some buttons are hidden when the program starts.  To reveal them, move the mouse to the bottom of the form.  Similarly, depending on the role based authorisations of the user, specific buttons can be hidden or display different messages.
Try logging on with different user names to see how the program's behaviour changes (the passwords are the same as the user names).
Derek.

Post's attachments

Attachment icon softjom.zip 676.76 kb, 173 downloads since 2022-02-11 

Re: Image Gallery

Good.
It is as explained by DEREK, I am using a library to be able to program CLIPPER in 32 and 64 bits.
But seeing the potential that MyVisualDataBase has and how easy it is, I'm trying to switch to this platform.
What happens is that I have to make sure that I can create controls from code in addition to being able to use standard MDV.
I already managed to pass the whole system, but I can't do it with the screen that I uploaded in the image.
Derek, I'm going to take a look at this example you shared with me, and try hiding and showing components as needed.
Thank you very much in advance for your patience.
Greetings.

Translated into English from Google translator

Re: Image Gallery

Good afternoon Derek. Following your example to create components by code, I manage to create the buttons but not the image components. I attach an example to see if you can show me what the problem is.
Thanks a lot !!! and sorry for my insistence.
Greetings.
Translated from Spanish with google translator.

Post's attachments

Attachment icon BDImg.zip 415.89 kb, 155 downloads since 2022-02-16 

Re: Image Gallery

Hi Softjom,
Perhaps try it like this (see attached).
Derek

Post's attachments

Attachment icon BDImg2.zip 499.19 kb, 187 downloads since 2022-02-16 

Re: Image Gallery

Hi Derek.
I was able to create the image controls by code, just like your example.
I have one last query, I need that when clicking on each image, a procedure or function is executed.
The problem I find is that I need to pass a parameter and when using a function, it is executed before creating the image and not when clicking on it, and if I use a procedure, I cannot pass a parameter.
I attach an example to solve the image.click problem.
I'm quite advanced with the system, I just have to solve this.
Thanks for your time.
Greetings..

Translated into English with google translate.

Post's attachments

Attachment icon BDImg2.zip 497.54 kb, 182 downloads since 2022-02-17