Project Viewer


https://blogger.googleusercontent.com/img/a/AVvXsEjB3XOYmlWKvxWKGQGZUYlqT7DG-2fmliluab24qjMqWzCzWD_ShvSkUuCOjmKwbsFjHSqbdeHSly9GuGfD4jKmtmXQNP8UNEmWI1_FzbqAGf_B69iLKY9RhhEQUrLQ5Z-7X1ZTqyPR1Q_0JEYV8-NjDE7Jw0K6NTEga8AnAU_4EKCP-PQBVdW-aayI

Моя работа над генератором экранных форм началась с исследований структуры файлов, которые определяют внешний вид и функциональность проектов, созданных в среде разработки My Visual Database. В этот раз мы узнаем структуру файла forms.xml, в котором хранятся все экранные формы приложения, а заодно научимся читать файлы в формате XML.


К сожалению, компоненты TfxXMLDocument и TfxXMLItem, которые входят в состав доступных компонентов для скриптов, имеют ряд ограничений функциональности, которая весьма затрудняет работу с ними. В частности, TfxXMLDocument не загружает документы в кодировке UNICODE, но при этом TfxXMLItem подразумевает внутреннее представление именно в этой кодировке. Поэтому после нескольких безуспешных попыток использовать данные классы для чтения файла forms.xml, я решил обратиться к технологии OLE, в частности использовать предлагаемый Microsoft MSXML2.


Второй серьёзной проблемой на пути к цели стало отсутствие полноценной поддержки рекурсивного вызова процедур в FastScript. Как мне показалось, проблема кроется в том, что все переменные в FastScript по сути глобальные, никакого стека памяти для хранения их значений нет. Но чтения древовидной структуры подразумевает именно рекурсивный вызов, поэтому пришлось поломать голову над организацией хранения данных, из-за чего внешний вид рекурсивной процедуры вышел не таким элегантным, как ожидалось.


Читать:  https://createmyvisualdatabaseapp.blogs … iewer.html

v_pozidis wrote:

( PRAGMA foreign_keys = ... ).

I don't understand what  I should do with that command.

Disable foreign key control before starting the import. This will allow you to add links to other entries that do not yet exist. That is, the order in which the tables are loaded will not matter.

SQLExecute('PRAGMA foreign_keys = off ');

And after all the records are loaded, the control must be turned on.

SQLExecute('PRAGMA foreign_keys = on ');

778

(8 replies, posted in General)

I think that the cursor in the input field is the property of the operating system.


You can emulate field input by intercepting keystrokes with a form event handler and displaying the result, including your own "cursor" in the label. But in my opinion, the effort spent on this will be unjustified.

Есть два варианта:


1) использовать для получения данных SQL-запрос с форматированием результата
2) написать скрипт, который бы менял пустые ячейки на '00:00'.

Switching to RAD studio will not solve the issues with import-export when changing the database structure. My work experience shows that there is no 100% solution to automate this process, you always have to make a structure change script manually. Although, as I wrote earlier, if you log changes to the structure, then this protocol can be used to correct. As for the integrity control, this is solved by temporarily disabling this control while the data is being loaded. ( PRAGMA foreign_keys = off )

781

(8 replies, posted in General)

In the OnSQLException handler, raise an exception, and in the event handler, catch it and perform the actions you need.

782

(8 replies, posted in Russian)

Ещё на шаг ближе к цели - анализирую файл tables.ini

http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&item=8610&download=0

Следующий этап - перенос метаданных проекта в более удобное для обработки и хранение представление: реляционные таблицы.

783

(8 replies, posted in Russian)

CDB wrote:

Here is a link to a fastscript forum concerning the use of TfsXMLDocument, they came to the conclusion it is better to use OLE  Microsoft.XMLDom.

http://forums.blumentals.net/viewtopic. … amp;t=7169

Thread:   http://forums.blumentals.net/viewtopic. … 169#p24988

Thank you for the information. The second unpleasant surprise from FastScript, which I almost forgot about, is the loss of data in the parameters of the recursive procedure. Only a recursive procedure is suitable for reading the forms.xml structure, so I had to create my own stack (in the form of an array and a pointer to the nesting level) to store the parameters passed. I will soon write a short note on this and other nuances in my blog.

784

(8 replies, posted in Russian)

Процесс движется медленно, но верно. Удалось заглянуть в файл forms.xml
А попутно выявить косяки во встроенном классе TfsXMLDocument и освоить работу с XML через OLE.

http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&item=8609&download=0

Для полной совместимости надо составить справочник свойств, которые сохраняется в XML для каждого класса. Потому как там есть весьма специфические, нигде не документированные и не совпадающие по названию со свойствами из редактора свойств или редактора скриптов....


По ходу исследования возникли новые идеи по применению утилиты. Например, массовое редактирование свойств (например, шрифт или цвет)

785

(4 replies, posted in General)

Faced a problem when using class TfsXMLDocument. Doesn't read UTP files, only ANSI. However, the Text property appears to be in the wrong encoding. Has anyone encountered a similar problem?

Картинки на кнопках

https://blogger.googleusercontent.com/img/a/AVvXsEhkh3CBNVjhogtSGQthcJAMsvxFzV9gECf63aOb8mQB1Z6ATqhX7dtt6XVS-cp7G5Vb5dlRCsr_9EllpZ3BdDQ7AsZqldJ51JS_swN4m783Iq0m_bmGEbqjWVjLEwz1_qGT2h5x_1DKX9xnYR_UN7kO34qiBpE3YnrK7WvuWVgXnTdHtVO8k5qDihvQ=w640-h530


После того, как часть основного функционала реализована, можно передохнуть и подумать об улучшении внешнего вида программы. Например, заменить стандартные изображения на кнопках на более современные и соответствующие выбранному цветовому оформлению.


Читать: https://createmyvisualdatabaseapp.blogs … st_29.html

teco049 wrote:

That's true. But MVD was never anything else for me as a cheaper and stripped tool instead of Embarcadero RAD Studio.

Cutting is sometimes beneficial: it increases the ease of use and the efficiency of solving highly specialized tasks. This is how I position the MVDB. I have been developing programs in Delphi for many years, I may come back to it again, but so far my best tool is MVDB.

788

(3 replies, posted in General)

Typically, such a message can appear when several users simultaneously try to change data in the DBMS SQLite. In this case, it is necessary to switch to the use of MySQL to fully support the multi-user mode.


The second typical case is if you get compiler errors during development, but the application still runs and can keep the database file from changing. In this case, you need to open Task Manager and kill all processes that have a connection to the database file.

789

(3 replies, posted in General)

I solved this problem by loading an HTML document before starting work.


begin
  // загрузить фон нужного цвета
  frmImageEdit.redTags.LoadHTML('back.pas');
  // организовать цвет текста и шрифт
  frmImageEdit.redTags.InsertTextEx(' ',$FFFFFF,11,0,'Segoe UI');
end.

back.pas:

<html>
 <head>
  <style>
   BODY { 
    font-size: 11; 
    font-family: Segoe UI; 
    color: #FFFFFF; 
    background: #394264
   }
  </style>
 <body bgcolor="#394264">
 </body>
 
</html>

Result:

http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&amp;item=8607&amp;download=0

teco049 wrote:

Unfortunately, in MVDB there is no way to record structure changes and save them as a SQL-script, so they can be used to automatically update the database structure. Therefore, your method is the only true one, I also use it.


If you can generate the sql statements for database alternation by yourself, you can add this in the scriptfile at the very end of the file. After all procedures/functions inside the final    begin    end    area.


This area is handled before the database is structural checked by MVD. After upgrading/changing you must restart your application to use the updated sql database.


This is the way I am doing it since many years without problem. Some additional infractructure in the dabase is required to catch the table information before altering.


Also I use this way to use the replaced sqlite.dll. My version has encryption included. Search the forum for more details on this and an example from Dimtry.   smile

All this is true, but you have to do double work: first change the structure of the database using the MVDB visual tools, and then write a SQL-script that will perform the same actions on the old version of the database for the end user. As a result, annoying mistakes happen. But if structure changes were logged in the format of SQL-commands, then this log could be used without fear that something was forgotten or missed.

v_pozidis wrote:

I have a project that from time to time I upgrade it, not only the software but also the database with new columns and tables, (with new relations between them). So my question is how can I transfer the existing records from the database to the new, without making the life of my customers difficult.
The only solution that I have is to create a small program all the time I make a change in the database that makes the job. The progress is simply I copy the "old" database in the folder of the program,  that add the new tables and columns and transferring the data's and run the program using Sqlite script (my sqlite script is very poor) . After that I copy and paste the "new" database to the new upgraded software folder.
To avoid all this does anyone know a simply way. Keep in mind that it will be for my customers which they do not have an experience of programming

Unfortunately, in MVDB there is no way to record structure changes and save them as a SQL-script, so they can be used to automatically update the database structure. Therefore, your method is the only true one, I also use it.


Perhaps there are third-party utilities that compare two databases and generate a script that matches the first structure with the second. If you find it, please let me know smile

792

(8 replies, posted in Russian)

Как я понял, для оживления дискуссии нужна хотя бы альфа-версия данной утилиты smile

793

(8 replies, posted in Russian)

Добрый день, уважаемые форумчане!


Хочу спросить, насколько актуальным для вас была бы возможность автоматического создания форм приложения на основании структуры таблиц базы данных?


https://ascend.marketing/wp-content/uploads/2019/02/CX_JourneyMapping_6000x4000.jpg


Планирую создать утилиту, которая автоматизирует часть процесса создания приложения. Вижу работу с утилитой, как выполнение нескольких шагов:


1. Выбор папки приложения, созданного в среде My Visual Database (считывание файла tables.ini)
2. Для каждой таблицы утилита предлагает создание табличного представления (формы с таблицей). В процесса создания можно настроить некоторые параметры (порядок следования колонок, наличие и внешний вид формы редактирования и т.д.)
3. Затем происходит создание главной формы приложения с выбором параметров (вид и состав пунктов меню, наличие на главной форме табличного представления и т.д.)
4. Автоматическая генерация форм проектов (файл forms,xml) и файла со скриптами для обеспечения базового функционала (script.pas)


Таким образом, создание приложения сведется к разработке структуры таблиц, а основную черновую работу возьмет на себя утилита-генератор форм. Останется только добавить какие-то специфические скрипты и декоративные элементы оформления. А ещё есть FastReport, с которым придется повозиться в любом случае, если потребуются печатные формы.

Component Explorer


https://blogger.googleusercontent.com/img/a/AVvXsEhJLTg-qa_xDRjBOwp3N5l6O8J2u5hxOj0mHNlFkwqjaGrmnJy7olgCfYOScL5YBknWH43jnFxjDVpRQf7X0z5dFe1yL9PgwEwNtJbrBjZJRgDcuvirup2MZY9ZDsjKQaKp_3TTnslwJXIMknJ1nmSrjZBEUFQzi0lAVrCs1Gh1E1O2sfR9eC2pmF82=w640-h430


Среда разработки My Visual Database хранит в себе множество тайн и загадок. Отчасти это связано с отсутствием детальной документации, которая бы позволила решить множество задач, в частности - кастомизацию системных форм ( "О программе", "Авторизация" и другие) или их локализацию. В статье "Hello, world!" я опубликовал в качестве бонуса пару строчек, меняющих внешний вид стандартной формы логина.  Настало время внимательно рассмотреть, что находится у MVDB под капотом.


Читать: https://createmyvisualdatabaseapp.blogs … lorer.html

sibprogsistem wrote:
k245 wrote:

Для меня это пока недоступный космос ))))

кажется, Вы ругаетесь )))))

нет, ворчу по-стариковски...

С другой стороны, что мешает сделать генератор форм самому? 


Давайте помечтаем...


https://static.orgpage.ru/socialnewsphotos/91/915558fa16894df799a35bee59653ce1.jpg


1. Генератор должен создавать формы как для MVDB (файл  FORMS.XML) , так и для WEB (набор файлов *.php)
2. Для работы генератора нужна только структура БД
3. Настройки прав хранятся в базе и осуществляются через интерфейс: десктоп и веб


Ничего не забыл? Ах, да, генератор - это приложение, созданное на платформе MVDB


https://www.shkolazhizni.ru/img/content/i239/239795_or.jpg

Формы генерятся комбинированные: табличная часть - PHP, а форма редактирования - JS.

sibprogsistem wrote:

нашел на просторах интернета систему управления контентом
CMS на основе API

https://getcockpit.com/

Для меня это пока недоступный космос ))))


Жаль, что автор MVDB забросил доработки, если бы к генератору web-форм добавить генератор авторизации, админ-панель и настройки прав на удаление/добавление/редактирование, то я бы на MVDB и на Марс полетел )))


http://myvisualdatabase.com/forum/misc.php?action=pun_attachment&amp;item=8570&amp;download=0

А без авторизации эти формы годятся только для тех, кто... уже умеет писать на PHP (((

Поиск по тегам

https://blogger.googleusercontent.com/img/a/AVvXsEhjQ8jzyCQ0GeLvqhZABcNJf7n03B1aePzamH-LHUirt9L_lcc-tpKBn-8s7u7ZnPdI2_mXp6djL7-9DUxjryhRyfaO-unqpFpMfOWqGLq6wkSVjWvG_6bNwR_pNw6lb-FXZ0GqFEujXfJ8iXLq0xKuB9Uu7sA65IfmyLZDjf0s7EbaMwQJuOtF-BqK=w640-h376


Эффективность поиска зависит от применяемых алгоритмов. У каждого изображения в базе хранится название, описание, а также список тегов. Поиск по текстовому названию и описанию самый простой в реализации. Но он же самый медленный, так как для поиска обычно используется условие LIKE, с помощью которого находится фрагмент текста. Альтернативным вариантом поиска, который успешно применяется во многих социальных сетях, является поиск по тегам - ключевым словам, ассоциированным с искомыми данными.


Читать: https://createmyvisualdatabaseapp.blogs … st_13.html

https://i10.fotocdn.net/s108/af99d8cfa84cc44b/public_pin_l/2386976494.jpg