51

(10 replies, posted in General)

Well why can't we? Can. There is more work in the script....
Don't you want to bypass this? Having created one TOP record, let's say DIRECTORY, and everything else will be child records, STANDS OF POSTCARDS, MAGAZINES, NEWSPAPERS...



If you need it more difficult...
Something like this
Edit the required fields for the entry.

52

(6 replies, posted in General)

date(Date_Appo) = CURRENT_DATE

Data of type DATE is stored as '2024-02-16 00:00:00.000'. And this is a text format.
When you set your condition, it turns out that '2024-02-16 00:00:00.000' = '2024-02-16' which is FALSE.
Therefore, DATE('2024-02-16 00:00:00.000') will highlight only the date and allow for a correct comparison.
Another possible solution would be to use LIKE.

53

(10 replies, posted in General)

This option is possible for TOP (separate button), child and editing. Everything is as simple as possible.

54

(10 replies, posted in General)

Hi Adam


If only a child record and quite simply, then like this

55

(11 replies, posted in General)

Calculation via Delphi functions.
Another algorithm for calculating sunset and sunrise.

56

(11 replies, posted in General)

Calculation of sunrise and sunset.


Option 3. All calculations are carried out in SQLITE in one query.
Options 1 and 2 also work.
Something like this.

The archive does not contain a folder with the script.

58

(11 replies, posted in General)

Well, if you have already written similar calculations before, ARCSIN ARCCOS ARCTAN ARCTAN2 will not be difficult for you. I only see this as a problem for converting to radians. And this is the first way.
The second way is to use a newer version of SQLITE and perform calculations through it.
Something like this )))

59

(11 replies, posted in General)

MVD doesn't support this.

You can write some simple functions yourself, but most are impossible.
If it's not a secret, what do you want from these libraries?

60

(38 replies, posted in Russian)

Да все именно так.
Для всех панелей создается универсальный OnPaint в котором и отрисовываются границы и закрашивание при необходимости.

При старте формы создаются панели и накладываются компоненты.
В событии OnPaint вызывается процедура отрисовки/перерисовки.
Tag формы использую для запоминания что панели созданы во избежании повторного создания и ошибки.
В некоторых случаях нужно использовать небольшую задержку по таймеру для отрисовки/перерисовки.
Код проще из за упрощения рисования RoundRect.

var
...
  arrFrm: array of TAForm = [Form1, Form2, Form3, Form4, Form5];                      // list of Forms

procedure Form1_OnShow (Sender: TObject; Action: string);
begin
  create(Sender);
end;
...
procedure create(Sender: TObject);
var
  tmpP: TdbPanel;
  i: integer;
  tmpMemo: TdbMemo;
...
  tmpForm: TAForm;
begin
     tmpForm := TAForm(Sender);
      if tmpForm.Components[i] is tdbEdit then                                          // Edit
      begin
        tmpEdit := TdbEdit(tmpForm.Components[i]);
        tmpEdit.borderstyle := bsNone;
        tmpP := tdbpanel.create(tmpForm);
        tmpP.name := 'tmp_'+tmpEdit.name;
        tmpP.Caption := '';
        tmpP.Parent := tmpEdit.Parent;
        tmpP.BevelWidth := 0;
        tmpP.SetBounds(tmpEdit.Left, tmpEdit.Top, tmpEdit.Width, tmpEdit.Height);
        tmpP.Anchors := tmpEdit.Anchors;
    //
        tmpEdit.Parent := tmpP;
        TControl(tmpEdit).SetBounds(4, 2, tmpEdit.Width - 8, tmpEdit.Height - 4);
      end;
...
procedure draw;
var                                                                                   // Draw and ReDraw
  i, f: integer;
  tmpPan: TdbPanel;
begin
    for i := 0 to arrFrm[f].componentcount - 1 do
    begin
      if (arrFrm[f].Components[i] is tdbpanel) and (copy(tdbpanel(arrFrm[f].Components[i]).name, 1, 4) = 'tmp_') then
      begin
        tmpPan := TdbPanel(arrFrm[f].Components[i]);
        tmpPan.canvas.brush.color := clWhite;
        tmpPan.canvas.pen.color := clBlack;
        tmpPan.canvas.roundRect(0, 0, tmpPan.width, tmpPan.height, 10, 10);
      end;
    end;
end;
...
procedure onp(Sender: Tobject);                                                       // OnPaint event
begin
  draw;
end;

61

(38 replies, posted in Russian)

k245 wrote:

Насчет скруглений - можно заморочиться и сделать так:
1) убрать штатные границы и добавить картинки с нарисованными круглыми рамками
2) убрать штатные границы и добавить TShape c закругленными углами.
3) убрать штатные границы и рисовать на канве формы/панелей


Константин,
Я попробовал третий вариант. Рабочий. Только требует дополнительной обработки в событии OnPaint


https://myvisualdatabase.com/forum/misc.php?action=pun_attachment&item=10236

62

(38 replies, posted in Russian)

Да Константин, вы полностью правы.


Из той же справки по ФастРепорт. Раздел про рисунки.

Следующий объект, который мы рассмотрим - это объект "Рисунок". Он также довольно часто используется в отчетах. С помощью объекта вы можете вставить в отчет логотип вашей фирмы, фотографию сотрудника или любую другую графическую информацию. Объект способен отображать графику в формате BMP, JPEG, ICO, WMF, EMF.

63

(38 replies, posted in Russian)

Может вы раздел откроете или PDF по фастрепорт скачаете.
Вот например открытый раздел "Построение отчетов" и видим целый раздел "Отчет с картинками".

64

(38 replies, posted in Russian)

Подозреваю, что от вас прячут эту информацию... Но вы не сдавайтесь, попробуйте ещё раз почитать.

65

(38 replies, posted in Russian)

https://www.fast-report.com/documentati … index.html

Roberto,


When checking, it turned out that there were some colors that caused the color switching effect when typing.
I'm posting the corrected version.
Thank you.

Hi Derek, Roberto


Some fixes and improvements have been made.
Completely (hopefully) fixed typing in color in Edit.


P.S.  I am posting the corrected version below in the posts.

68

(38 replies, posted in Russian)

k245 wrote:

Вот пример создания Мемо с закруглениями:
...

2d массив не пошел. Было бы понятнее.
Можно большой массив разделить на две части(фигура и служебные)
На счет правильности оригинальных суффиксов не уверен.

var
...
  arrSX : Array[0..9] of string = ['_TL','_TR','_BL','_BR','_HR','_VR','_TP','_BT','_LF','_RG'];
  arrParam: Array[0..89] of integer = [5,1,2,0,0,0,0,RP_SIZE,RP_SIZE,
                                     5,0,2,4,0,AMemo.Width-RP_SIZE,0,RP_SIZE,RP_SIZE,
                                     5,1,0,0,8,0,AMemo.Height-RP_SIZE,RP_SIZE,RP_SIZE,
                                     5,0,0,4,8,AMemo.Width-RP_SIZE,AMemo.Height-RP_SIZE,RP_SIZE,RP_SIZE,
                                     0,1,2,4,8,0,RP_SIZE div 2,AMemo.Width,AMemo.Height-RP_SIZE,
                                     0,1,2,4,8,RP_SIZE div 2,0,AMemo.Width-RP_SIZE,AMemo.Height,
                                     0,1,2,4,0,RP_SIZE div 2,0,AMemo.Width-RP_SIZE,1,
                                     0,1,0,4,8,RP_SIZE div 2,AMemo.Height-1,AMemo.Width-RP_SIZE,1,
                                     0,1,2,0,8,0,RP_SIZE div 2,1,AMemo.Height-RP_SIZE,
                                     0,0,2,4,8,AMemo.Width-1,RP_SIZE div 2,1,AMemo.Height-RP_SIZE];
        //(Shape,akLeft,akTop,akRight,akBottom,Left,Top,Width,Height)
begin
...
  while i <= 89 do
  begin
    s := TShape.Create(tmpForm);
    s.Name := T_SHAPE + tmpName + arrSX[i div 9];
    s.Parent := tmpPanel;
    s.Shape := arrParam[i];
    s.SetBounds(arrParam[i+5],arrParam[i+6],arrParam[i+7],arrParam[i+8]);
    s.Anchors := arrParam[i+1]+arrParam[i+2]+arrParam[i+3]+arrParam[i+4];
    i := i + 9;
  end;
...

69

(38 replies, posted in Russian)

Занимательно )))

70

(5 replies, posted in Database applications)

jrga wrote:

I'm sorry it doesn't work in MVD 5.6....


Supports versions 5.6 and higher

Hi Derek.

The first question from the program can be easily solved. For example, like this:

  for i := 0 to Screen.formCount - 1 do
  begin
    if (TAForm(Screen.Forms[i]).KeyPreview) and
       (SQLExecute('SELECT COUNT(id) FROM tbl_forms WHERE nome_form = '''+TAForm(Screen.Forms[i]).name+'''') = 0) then
          SQLExecute('INSERT INTO tbl_forms (nome_form, cor_form, cor_lbl_form, cor_textbox, cor_fore_textbox, cor_fore_memo, cor_memo, cor_panel) '+
          'VALUES('''+TAForm(Screen.Forms[i]).name+''', 15790320, 0, 16777215, 0, 16777215, 0, 15790320)');
  end;

But I haven’t checked the second one and it’s an interesting question to look into.

Hi Roberto,

Let's simplify the script a little.
Something like this

73

(5 replies, posted in Database applications)

Hi Jean


It's easier to do this without adding columns using

Form1.TreeView1.Row[i].Level

.


I'm using this function in a script.


The function will return 0, 1, 2 or 3 for the string.
0 - root
1 - musician
2 - album
3 - extra disks

Good luck in expanding the project. If you have any questions, write.

74

(5 replies, posted in Database applications)

Something like this

проблема в том, что SQLExecute не может вернуть более одной записи.