1

(22 replies, posted in General)

jrga wrote:

I made some modifications to the "Family Album" project, created by K245 and which received corrections and improvements from Sparrow, listed below:

01 - Translation of the "captions" (names of forms, labels and buttons) into Portuguese through instructions included at the end of the script between BEGIN and END.

02 - In the search field on the main screen, I included:
* Search by CATEGORY by simply typing the name, after unchecking the "TAG" and "OR" checkboxes. In the previous form, the user had to select all the TAGs of a category.

* The content of the search field is cleared with 2 clicks.
03 - Inclusion of a "NO TAG" button for searching for photos without TAGs, considering that photos without TAGs do not have an associated category, which can be more easily corrected with this.

04 - Inclusion of a Backup button, which zips the "sqlite.db" database and the "image" folder, which contains the photos. Sparrow provided the script for zipping the database.

05 - In the "image editing" form, below the thumbnail and TAG field, I included a field that gives access to a folder selected by the user and another that executes a file also chosen by the user. When one of these fields is filled in, a red bar appears over the thumbnail with the title "Double Click". When clicked, the folder is opened or the file is executed. I included this option in case the user has many folders with photos. Thus, they can choose one photo from each folder. I chose to convert the photos from a folder into a single PDF file, which is opened when I double-click on the thumbnail. The use of this feature is optional.

P.S.: I forgot to mention:
* At the top of the "TAG" grid, I included a button to call "Categories" directly;
* In the TAG and Category grids, I included a column with the total number of photos that use a specific TAG or category. This makes it easier to delete TAGs or Categories without any linked photos.
* I created a view - it's in the script - that is used to display only photos whose categories have the new "hide" field = false (or zero in SQL), which can be filled in during category registration. Thus, if one or more photos have a single TAG linked to a "hidden" category, these photos will not be displayed.

2

(22 replies, posted in General)

I made some modifications to the "Family Album" project, created by K245 and which received corrections and improvements from Sparrow, listed below:

01 - Translation of the "captions" (names of forms, labels and buttons) into Portuguese through instructions included at the end of the script between BEGIN and END.

02 - In the search field on the main screen, I included:
* Search by CATEGORY by simply typing the name, after unchecking the "TAG" and "OR" checkboxes. In the previous form, the user had to select all the TAGs of a category.

* The content of the search field is cleared with 2 clicks.
03 - Inclusion of a "NO TAG" button for searching for photos without TAGs, considering that photos without TAGs do not have an associated category, which can be more easily corrected with this.

04 - Inclusion of a Backup button, which zips the "sqlite.db" database and the "image" folder, which contains the photos. Sparrow provided the script for zipping the database.

05 - In the "image editing" form, below the thumbnail and TAG field, I included a field that gives access to a folder selected by the user and another that executes a file also chosen by the user. When one of these fields is filled in, a red bar appears over the thumbnail with the title "Double Click". When clicked, the folder is opened or the file is executed. I included this option in case the user has many folders with photos. Thus, they can choose one photo from each folder. I chose to convert the photos from a folder into a single PDF file, which is opened when I double-click on the thumbnail. The use of this feature is optional.

3

(4 replies, posted in General)

Happy New Year!

4

(22 replies, posted in General)

sparrow wrote:

Hi Roberto


The code allows you to compress the sqlite.db file using Windows tools in zip format without additional copying and compression operations.
Caution: TDataSet resources must be freed.


Hi Sparrow, thank you for resolving the sqlite.db zipping issue.

5

(22 replies, posted in General)

Backup Routine (I combined 2 scripts from the forum):
1 - backs up the sqlite.db file, but MVD doesn't allow compression.
2 - creates a zipped backup of the "image" folder, which contains the photos.


procedure frmImage_btn_bkp_OnClick (Sender: TObject; var Cancel: boolean);
var
    SaveDialog: TSaveDialog;
    sFileName,sDirName: string;
begin
    showmessage('Para iniciar Backup do Banco de Dados pressione OK');
    sFileName := 'Sqlite-' + FormatDateTime('dd-mm-yyyy hh-nn-ss', now)+'.db';
    SaveDialog := TSaveDialog.Create(frmimage);
    SaveDialog.FileName := sFileName;
    SaveDialog.Filter := 'Database|*.db|Any file|*.*';
    SaveDialog.Options := ofOverwritePrompt+ofHideReadOnly+ofEnableSizing;

    if SaveDialog.Execute then
    begin
        CopyFile(ExtractFilePath(Application.ExeName)+'sqlite.db', SaveDialog.FileName);
        ShowMessage('Banco de dados foi salvo na pasta especificada');
    end;

    SaveDialog.Free;

    showmessage('Para iniciar Backup da pasta de imagens pressione OK');
    sDirName := 'Imagens-' + FormatDateTime('dd-mm-yyyy hh-nn-ss', now)+'.zip';
    SaveDialog := TSaveDialog.Create(frmimage);
    SaveDialog.FileName := sDirName;
    SaveDialog.Filter := 'Selecione uma pasta para salvar|*.*';
    SaveDialog.Options := ofPathMustExist + ofEnableSizing;

    if SaveDialog.Execute then
    begin
        frm_aviso.Show;
        CompressZipDirectory(ExtractFilePath(Application.ExeName)+'image\', SaveDialog.FileName);
        frm_aviso.close;
        ShowMessage('Imagens foram salvos na pasta especificada');
    end;

    SaveDialog.Free;
end;

6

(22 replies, posted in General)

begin
    //Change caption and hint to the Portuguese language and etc.
    frmImage.Caption := 'Álbum de Fotografias';
    frmImage.btnDelete.caption := 'Excluir';
    frmImage.btnEdit.caption := 'Editar';
    frmImage.btnNew.caption := 'Adicionar';
    frmImage.btnPlay.caption := 'Slides';
    frmImage.chbOR.caption := 'OU';
    frmImage.chbShowPreview.caption := 'Visualizar';
    frmImage.chbTag.caption := 'TAG';
    frmImage.labDescription.caption := 'Descrição';
    frmImage.labName.caption := 'Nome';
    frmImage.btnFirst.Hint := 'Vai para a primeira página';
    frmImage.btnLast.Hint := 'Vai para a última página';
    frmImage.btnNext.Hint := 'Vai para a página anterior';
    frmImage.btnPred.Hint := 'Vai para a primeira página';
    frmImage.btnTag.Hint := 'Selecione as tags do diretório';
    frmImage.edtFilter.Hint := 'Clique 2x para limpar filtro.';
    frmImage.edtFilter.TextHint := 'Busca por marca (TAG)';
    frmImage.Epage.Hint := 'Entre com a página e pressione ENTER';

    frmTag.Caption := 'Marcação (TAG)';
    frmTag.btnClear.Hint := 'Limpar seleção';
    frmTag.btnDelete.Caption := 'Excluir';
    frmTag.btnEdit.Caption := 'Editar';
    frmTag.btnNew.Caption := 'Adicionar';
    frmTag.btnSelect.Caption := 'Selecionar';
    frmTag.labTagCategory.Caption := 'Categoria:';

    frmTagEdit.Caption := 'Marcação (TAG)';
    frmTagEdit.btnCancel.Caption := 'Cancelar';
    frmTagEdit.btnSave.Caption := 'Salvar';
    frmTagEdit.labCategory.Caption := 'Categoria';
    frmTagEdit.labName.Caption := 'Marcação (TAG)';

    frmTagCategory.Caption := 'Categorias das TAGs';
    frmTagCategory.btnDelete.Caption := 'Excluir';
    frmTagCategory.btnEdit.Caption := 'Editar';
    frmTagCategory.btnNew.Caption := 'Adicionar';
    frmTagCategory.tgrMain.dbListFieldsNames   := 'Categoria';

    frmTagCategoryEdit.Caption := 'Categoria';
    frmTagCategoryEdit.btnCancel.Caption := 'Cancelar';
    frmTagCategoryEdit.btnSave.Caption := 'Salvar';
    frmTagCategoryEdit.labName.Caption := 'Nome';

    frmImageEdit.Caption := 'Edição de imagem';
    frmImageEdit.btnCancel.Caption := 'Cancelar';
    frmImageEdit.btnEdit.Caption := 'Editar';
    frmImageEdit.btnSave.Caption := 'Salvar';
    frmImageEdit.Label1.Caption := 'Nome';
    frmImageEdit.Label2.Caption := 'Descrição';
    frmImageEdit.Label3.Caption := 'Data/hora de criação';
    frmImageEdit.Label4.Caption := 'Pré-visualização';
    frmImageEdit.Label5.Caption := 'Marcação (TAG)';
    //frmImageEdit.imgPreview.Hint := 'Clique 2x para abrir arquivo abaixo se existir.';

    frmImageEditor.caption := 'Inclusão de Foto e Edição de Miniatura';
    frmImageEditor.btnCancel.caption := 'Cancelar';
    frmImageEditor.btnClear.caption := 'Limpa';
    frmImageEditor.btnFilter.caption := 'Carrega';
    frmImageEditor.btnSave.caption := 'Salvar';

    frmShow.caption := 'Slides';
    frmShow.btnFirst.Hint := 'Primeiro Slide';
    frmShow.btnFullScreen.Hint := 'Tela cheia';
    frmShow.btnLast.Hint := 'Último Slide';
    frmShow.btnNext.Hint := 'Próximo Slide';
    frmShow.btnPred.Hint := 'Slide Anterior';
    frmShow.btnSettings.Hint := 'Setup';
    frmShow.labDescription.caption := 'Descrição';
    frmShow.labName.caption := 'Nome';
    frmShow.btnPlay.Hint := 'Exibe Slides sequencialmente';

    //It improved the display of full-screen forms and their buttons on my computer.
    frmImage.WindowState := wsMaximized;
    frmImageEditor.WindowState := wsMaximized;
    frmImageEdit.WindowState := wsMaximized;
end.

7

(22 replies, posted in General)

sparrow wrote:

Hi all,


ESC exit added to some forms.
The FullScreen button has been enabled.
Two thumbnails have been added to the main screen.
Thumbnail cropping behavior has been changed:
- When adding an image, the default thumbnail is the entire image.
- The ability to crop a thumbnail of any size.
- Thumbnail cropping within the image boundaries.
Other changes...

Hi Sparrow! I tested the improvements you implemented in the Photo Album project, created by K245:
- "ESC" on certain screens.
- Full screen in the "Slides" form.
- Full filling of the initial screen with thumbnails.
- Automatic cropping when adding new images.
- Thumbnail cropping of any size, which allowed zooming in on any part of the image!

Everything looks great! Congratulations and thank you. Best regards.

8

(22 replies, posted in General)

sparrow wrote:

Hi Roberto


Could you elaborate on this?

- When the initial screen has more than one page of thumbnails, two thumbnails are missing to complete the first page...

A screenshot would be ideal.

As for finalizing the project, it's all in your hands. I'm just trying to fix a few things or do things differently. For me it's a good study...


P.S.
I understand what you're talking about.
In Project K245, the program was configured to display 30 thumbnails per screen (you see three rows of eight thumbnails, plus six more), which was optimal at the time. When I made changes to the code that sped up thumbnail display, I didn't change the number of thumbnails displayed. The trick is that if display scaling is applied in Windows, the layout changes. It also changes when the window is resized or maximized to full screen.

Hi Sparrow, screenshot attached. I put it in full screen and the problem persists. It's just a cosmetic detail and doesn't interfere with operation. It's fine if it's not possible to change. Regards

9

(22 replies, posted in General)

sparrow wrote:

Hi all,

Added to previous improvements:


! Thumbnail loading time has been accelerated when refreshing the panel and switching pages.
! Changes have been made to the form resize and thumbnail selection events.
Other improvements.


Previous fixed versions have been removed from the forum.

Hi Sparrow, the improvements you made are great. The thumbnail loading was really slow... If I may offer a few suggestions (you've already done a lot for this project), provided you have the time and inclination:

- Some screens could be closed with "escape," especially the initial screen.

- When the initial screen has more than one page of thumbnails, two thumbnails are missing to complete the first page...

- In the slideshow presentation, making the "full screen" and "setup" buttons functional would be nice. The "setup" button could allow the user to change the display time per slide.

Thank you and best regards.

Another project, which uses the capabilities of the MVD's sqlite interpreter, allows typing + <ENTER> with the execution of SQL commands in real time. The command inputs are stored and can be navigated using the up and down arrows, avoiding retyping.
The "Zoom" form allows you to type and view SQL instructions that occupy more than one line. When you exit with "ESC", the instructions are transferred to the line that executes them with ENTER. The "Help SQL" form displays the syntax of the main commands, and new ones can be entered. Perhaps it could be used as support in sqlite classes. I don't know what name I could give it. Any improvement is welcome.

11

(22 replies, posted in General)

sparrow wrote:

Page navigation has been added.
Inaccuracies, including mine, have been corrected.
Errors are possible.

Hi Sparrow! I tested the "delete" button and the page advance. Everything is working perfectly. It's fantastic! Other users will certainly be happy with this too. Thank you very much. Thanks also to K245 for being the author of this project.

12

(22 replies, posted in General)

sparrow wrote:

Hi Roberto


I don't think Konstantin couldn't fix it. It's his brainchild, like many other interesting projects. As he himself writes, the project turned out to be quite complex and large. During and after his work on it, it was rethought. Perhaps it will evolve into something else as a sequel.
Besides, there are internet issues.
Konstantin describes all projects in sufficient detail to teach others. But it doesn't always find user feedback due to the programming style, which is difficult for beginners. But you have to study.
I know there are some flaws, some inaccuracies, and some unfinished parts of the program.
I'll see what can be done.

Google translate.

Hi Sparrow, I want to clear up a misunderstanding. I think k245 has a lot of technical expertise to make the corrections to the project. What I meant was that he might not have the time available. Regards.

13

(22 replies, posted in General)

sparrow wrote:

Hi Roberto


Go to " RELEASE\Script\VClass\ImageEdit " and replace the file with this one.

Dear Sparrow, I have another request regarding the photo album created by K245. I don't want to abuse your willingness to always help when possible. You solved a problem, and I think K245 wasn't available to do this, but I thank you both. If possible, could you make the "delete" button on the home screen work? I don't know how to do this given the complex and efficient code created by K245. My knowledge of MVD was entirely acquired through the forum. I also ask, if possible, to include page advance on the home screen. K245 himself said that this didn't yet exist in the project. It's okay if you can't fulfill my request. What I've done so far is translate all the comments and captions into Portuguese and include the close button (sometimes hidden) on some screens, so that it's possible to close them simply with "escape". I used the MVD 5.6 form editor, but without compiling the project, keeping the execution through the executable (MVD 6.5) provided by k245. Regards.

14

(16 replies, posted in Russian)

While most systems rely on storing data, which must be organized into interconnected tables, processing that data, and generating reports (summaries, graphs, etc.), MVD, which does this splendidly and very easily, will remain relevant for a long time!

15

(22 replies, posted in General)

sparrow wrote:

Hi Roberto


Go to " RELEASE\Script\VClass\ImageEdit " and replace the file with this one.

Hi Sparrow, it worked!! Thank you so much!

I have a table with 32,000 Service Orders that is linked to a table with 13,000 clients. Accessing the service orders of a specific client was very time-consuming. In the "Service Order List," I added a button to call a small form containing a table grid with the IDs and names of the clients, where I can search by name or ID. When the client is found (it's very fast), the form closes, and the ID of the selected client is placed in the search field of the "Service Order List" form, which performs the search automatically. Everything solved in fractions of a second!

I confirmed that the selected record in the tablegrid was successfully deleted using the button.


procedure frm_help_sql_btn_del_OnAfterClick (Sender: TObject);
begin //*** Proc 1370 - confirma se deleção foi bem sucedida
    if frm_help_sql.TableGrid_instrucoes.SelectedRow = -1 then
    begin
        frm_help_sql.Edit_instrucao.Clear;
        frm_help_sql.Memo_ajuda.Clear;
        frm_help_sql.chk_alterado.Checked := false;
    end;
end;

18

(13 replies, posted in General)

sparrow wrote:

- Minor bug fixes.
- Button layout changed.
- Color identification added.
- Ability to select numbers from the keyboard (1..9) or (q,w,e,a,s,d,z,x,c).
- Tested with version 5.6.
- Sqlite.dll replaced with a newer version, file attribute set to ReadOnly (for future use with the solver).
- 250 of 509 recorded levels tested (thanks to Roberto). No errors.

Hi Sparrow! Congratulations!!! I completed a game and was able to test all the features. Everything worked correctly:

- The highlighting of identical numbers,

- The "pencil mode" annotations and the logic involved,

- The blocking of "wrong" number insertion and the highlighting of these errors in red.

It turned out great. I'll try importing the remaining 3 million Sudoku games later, of which I've already imported the 500 that are in the project. Thank you for your effort and the final result. Thanks also to Derek for his participation and contribution.

19

(13 replies, posted in General)

derek wrote:

Hi Roberto, Sparrow,
You first need to click on a number (1-9) and then click in the cell where you want to place that number.  Perhaps you are trying to do it the other way round?
Similarly, if you want to place "possible" numbers, first click on a number (1-9), then click on the 'pencil' and then click in the cell(s) where you want to place that "possible" number (it's a really neat feature).
Thanks,
Derek.

Hi Sparrow, I managed to start testing with the steps you provided. I missed the highlighting of identical numbers when a number is selected (see attached photo). I've never used the "pencil mode" note-taking system (I learned to do sudoku on paper...) and I think the logic you used to make this option available must have been very complex! But I'll still test this feature and come back here to give feedback. I noticed that when trying to enter a "wrong" number, the application highlights in red that the number already exists...

20

(13 replies, posted in General)

sparrow wrote:

Hi Derek, Roberto


Early version.
To be continued. Errors are possible.
Bugs and suggestions are welcome.


Hi Sparrow! I tested the project with MVD 5.6, but I couldn't select the cells or enter any numbers... What am I doing wrong?

21

(22 replies, posted in General)

k245 wrote:

Check out my project "Family Album". To speed things up, for each image, I create a thumbnail that is displayed in a grid. I use the tag system to search.


https://k245.ru/wp-content/uploads/2022/06/%D0%93%D0%B0%D0%BB%D0%B5%D1%80%D0%B5%D1%8F-2.png


https://k245.ru/en/mvdb-en/family-album.html

Hi K245! I really liked your Family Album project! I encountered a problem, which I'll show in the attached photo. The first time an image is edited, when the user wants to change the mini-photo that will be displayed on the home screen, everything works correctly. If the user enters the same screen a second time, the frame displaying the mini-photo disappears. The only way to solve this is to restart the application. I tried to identify which part of the script this happens in, but my knowledge of MVD is not yet sufficient. I would appreciate it if you could fix this part.

22

(17 replies, posted in General)

k245 wrote:

Hi, Sparrow!

I used TImage capabilities to scale the image. See the "Family Album" project (script folder "ImageEdit")

https://k245.ru/software-ru/is-ru/semejnyj-albom-2.html


You may need two copies of the image: one for display on the desktop (visible) and one for scaling/re-sizing etc. (hidden).

https://k245.ru/wp-content/uploads/2024/06/Albom-3.png

Hi K245! I really liked your Family Album project! I encountered a problem, which I'll show in the attached photo. The first time an image is edited, when the user wants to change the mini-photo that will be displayed on the home screen, everything works correctly. If the user enters the same screen a second time, the frame displaying the mini-photo disappears. The only way to solve this is to restart the application. I tried to identify which part of the script this happens in, but my knowledge of MVD is not yet sufficient. Also, my MVD version is 5.6. I would appreciate it if you could fix this part.

Attached is the file Derek sent again, now in RAR format. See if you can download it.

In the project contained in the topic below, I included the following procedure for creating "SQL Views" and changed parts of the script, as follows. The form opening time (attached photo) increased significantly. The slowdown was due to the query's main table containing 32,000 records.


https://myvisualdatabase.com/forum/view … hp?id=8659


procedure create_views_ano_mes;
begin //*** Proc 1364 - cria view se não existir
  if sqlexecute('SELECT name FROM sqlite_master WHERE type="view" AND name="view_ano"') = '' then
     SQLExecute('CREATE VIEW view_ano AS '+
                ' select distinct strftime("%Y",tbl_orderm_servico.entrada) as ano '+
                ' from tbl_orderm_servico order by 1 desc ');

  if sqlexecute('SELECT name FROM sqlite_master WHERE type="view" AND name="view_mes"') = '' then
     SQLExecute('CREATE VIEW view_mes AS '+
                ' select distinct strftime("%m",tbl_orderm_servico.entrada) as mes '+
                ' from tbl_orderm_servico order by 1 ');
end;

I changed the previous section:


    
frmOverview.cbo_ano.dbSQLExecute('select strftime("%Y",tbl_orderm_servico.entrada) as ano from tbl_orderm_servico group by ano order by 1 desc');
frmOverview.cbo_mes.dbSQLExecute('select strftime("%m",tbl_orderm_servico.entrada) as mes from tbl_orderm_servico group by mes order by 1');

for:


    
frmOverview.cbo_ano.dbSQLExecute('select ano from view_ano');
frmOverview.cbo_mes.dbSQLExecute('select mes from view_mes');
k245 wrote:

https://k245.ru/wp-content/uploads/2023/11/image-8-1024x573.png
For large data sets, I abandoned the combobox,
https://k245.ru/wp-content/uploads/2023/11/image-9-1024x598.png
replacing it with two components: an input field (to display the selected value) and a button (to display the reference form). Of course, you will need scripts, examples of which can be found in this project.
https://k245.ru/en/mvdb-en/light-filtered.html

Hi k245! You're right! I have a form with a combo box that retrieves data from a table with 13,000 records, which makes the form very slow to open. I used the text box and a button next to it to retrieve the information from another form and fill in the text box, which made everything much faster.