7,076

(2 replies, posted in General)

You can enable scrolbars only for form, an example:

 Form1.VertScrollBar.Range := 1000;
 Form1.VertScrollBar.Tracking := True;

 Form1.HorzScrollBar.Range := 1000;
 Form1.HorzScrollBar.Tracking := True;

7,077

(33 replies, posted in Russian)

nikolai_nn
Вам необходимо, чтобы условие срабатывало, когда будет выбран первый пункт?
тогда попробуйте так


procedure Form1_cbStatus_OnChange (Sender: string);
begin
  if Form1.cbStatus.ItemIndex = 1 then
     Form1.Button4.Click; // если выбран нужный пункт
end;

свойство dbItemID возвращает идентификатор записи (не порядковый номер записи)
свойство ItemIndex возвращает порядковый номер записи

Готово

7,079

(5 replies, posted in Russian)

если необходимо выделять всю строку, тогда так:

procedure Form1_TableGrid2_OnChange (Sender: string);
/////// Цвет фона ячейки грида при условии /////////////
var
    i,c: integer;
    k,q: integer; 
    sDate: string;
begin
    c := Form1.TableGrid2.RowCount - 1;
    q := Form1.TableGrid2.Columns.Count - 1;
    for i := 0 to c do
    begin
        sDate := Form1.TableGrid2.Cells[5,i];
        if (StrToDate(sDate) - now) < 1 then for k := 0 to q do Form1.TableGrid2.Cell[k,i].Color := $007175BD
        else if (StrToDate(sDate) - now) < 3 then for k := 0 to q do Form1.TableGrid2.Cell[k,i].Color := clYellow
        
        
        if Form1.TableGrid2.Cells[4,i] = 'Нет' then for k := 0 to q do Form1.TableGrid2.Cell[k,i].Color := clGray;        
    end;
end;


по поводу цвета ячейки, скорей всего вы имеете ввиду, что цвет ячейки перекрывается цветом выделенной записи (когда запись выделена мышкой), поэтому можете просто убирать выделение записи так: Form1.GridPhones.SelectedRow := -1;

procedure Form1_table_clients_OnCellClick (Sender: string; ACol, ARow: Integer);
begin
    Form1.bPhones.Click;
    Form1.bEmails.Click;
    Form1.GridPhones.SelectedRow := -1;
end;

7,080

(33 replies, posted in Russian)

nikolai_nn
тогда я уже ответил на этот вопрос.

7,081

(33 replies, posted in Russian)

nikolai_nn
А куда именно вы вводите вычисление 2х2,5 ?



Шрифт сообщения к сожалению увеличить не получится, но вы можете создать форму с необходимым сообщением и шрифтом, затем вместо ShowMessage вызвать форму с сообщением, например Form2.ShowModal;

7,082

(5 replies, posted in Russian)

Проверил ваш проект, все работает, напишите более подробней с именами названий гридов, что именно и как не работает по шагам.


При первом поиске у вас заполняется грид table_clients, для которого нет скрипта раскраски.

7,083

(5 replies, posted in Russian)

второй скрипт с ошибкой, в итоге будет так

procedure Form1_TableGrid2_OnChange (Sender: string);
/////// Цвет фона ячейки грида при условии /////////////
var
    i,c: integer;
    sDate: string;
begin
    c := Form1.TableGrid2.RowCount - 1;
    for i := 0 to c do
    begin
        sDate := Form1.TableGrid2.Cells[5,i];
        if (StrToDate(sDate) - now) < 1 then Form1.TableGrid2.Cell[5,i].Color := $007175BD
        else if (StrToDate(sDate) - now) < 3 then Form1.TableGrid2.Cell[5,i].Color := clYellow
        
        
        if Form1.TableGrid2.Cells[4,i] = 'Нет' then Form1.TableGrid2.Cell[4,i].Color := clGray;        
    end;
end;

7,084

(5 replies, posted in Russian)

ivan.kulikov95 wrote:

Большое спасибо, всё сделал уже. У меня ещё пару вопросов, после покупки можно менять строку меню и значок на свой?

Меню можно изменить с помощью скрипта, пример:
http://myvisualdatabase.com/forum/viewtopic.php?id=1092



Изменение иконки приложения пока не поддерживается, но вы можете сменить его с помощью сторонней утилиты Resoure Hacker.

7,085

(33 replies, posted in Russian)

nikolai_nn
1. Да, создайте событие OnClick для кнопки "Edit"

procedure Form1_Button4_OnClick (Sender: string; var Cancel: boolean);
begin
    if Form1.TableGrid1.dbItemID = -1 then
    begin
        ShowMessage('Выберите запись для редактирования');
        Cancel := True;
    end;
end;

2. Десятичный знак задается в региональных настройках Windows, установите у компонента Edit свойство NumbersOnly=True, тогда неверный десятичный знак не будет печататься.



Либо можете с помощью скрипта заменять например знак "," на "."

procedure Form1_Edit1_OnKeyPress (Sender: string; var Key: Char);
begin
    if Key=',' then Key := '.';
end;

7,086

(9 replies, posted in Russian)

Вы про компонент Counter?
Необходимо в таблице БД создать поле "Счетчик", на форме расположить компонент Counter и добавить его в настройках кнопки с действием "Сохранить запись"

7,087

(9 replies, posted in Russian)

Попробуйте так

printf( 'Осталось %d дней', CASE WHEN Round( julianday([date]) - julianday('now') ) < 0 then '0' else Round(julianday([date]) - julianday('now'))+1 end )

7,088

(9 replies, posted in Russian)

combelg wrote:

Пишет ошибку  column:yourdatefield
Может я что-то не то пишу, в программе всего день.

вместо yourdatefield вам необходимо подставить название вашего поля даты.



Приложите к сообщению ваш проект (zip файл без exe и dll)
Пожалуйста, укажите название формы и грида, в котором это необходимо реализовать.

7,089

(9 replies, posted in Russian)

попробуйте создать вычисляемое поле такого вида:

printf( 'Осталось %d дней', Abs(Round(julianday('now') - julianday(yourdatefield))) )

7,090

(14 replies, posted in General)

tcoton wrote:

I found a bug in final version 1.51:

if you use "AR_" as a TextBox Mask, the "A" is replaced by "_" which gives "_R_".


Could you have a look please?

It's not bug, try this mask:
>\ARa;1;_





EditMask is a string that consists of three fields with semicolons separating them. The first part of the mask is the mask itself. The second part is the character that determines whether the literal characters of a mask are saved as part of the data. The third part of the mask is the character used to represent unentered characters in the mask.

These are the special characters used in the first field of the mask:



!
If a ! character appears in the mask, optional characters are represented in the text as leading blanks. If a ! character is not present, optional characters are represented in the text as trailing blanks.

>
If a > character appears in the mask, all characters that follow are in uppercase until the end of the mask or until a < character is encountered.

<
If a < character appears in the mask, all characters that follow are in lowercase until the end of the mask or until a > character is encountered.

<>
If these two characters appear together in a mask, no case checking is done and the data is formatted with the case the user uses to enter the data.

\
The character that follows a \ character is a literal character. Use this character to use any of the mask special characters as a literal in the data.

L
The L character requires an alphabetic character only in this position. For the US, this is A-Z, a-z.

l
The l character permits only an alphabetic character in this position, but doesn't require it.

A
The A character requires an alphanumeric character only in this position. For the US, this is A-Z, a-z, 0-9.

a
The a character permits an alphanumeric character in this position, but doesn't require it.

C
The C character requires an arbitrary character in this position.

c
The c character permits an arbitrary character in this position, but doesn't require it.

0
The 0 character requires a numeric character only in this position.

9
The 9 character permits a numeric character in this position, but doesn't require it.

#
The # character permits a numeric character or a plus or minus sign in this position, but doesn't require it.

:
The : character is used to separate hours, minutes, and seconds in times. If the character that separates hours, minutes, and seconds is different in the regional settings of the Control Panel utility on your computer system, that character is used instead.

/
The / character is used to separate months, days, and years in dates. If the character that separates months, days, and years is different in the regional settings of the Control Panel utility on your computer system, that character is used instead.

;
The ; character is used to separate the three fields of the mask.

_
The _ character automatically inserts spaces into the text. When the user enters characters in the field, the cursor skips the _ character.

7,091

(3 replies, posted in General)

Hello,


Please download latest beta version
https://www.dropbox.com/s/s1roiqthyx7hx … 2.zip?dl=0


added two properties


Application.HintHidePause := 2500;

Specifies the time interval to wait before hiding the Help Hint if the mouse has not moved from the control.
The default value is 2500 milliseconds.


Application.HintPause := 500;

Specifies the time interval that passes before the control's Help Hint appears when the user places the mouse pointer on a control.
The default pause time of 500 milliseconds

7,092

(1 replies, posted in Russian)

И так и так будет работать )

Please download latest beta version 1.52
https://www.dropbox.com/s/s1roiqthyx7hx … 2.zip?dl=0

Создаю проект в 1.46, настраиваю грид, файл как в вашем примере и всё? все что у вас там написано в скрипте не надо?

Именно так, скрипт в вашем случае не нужен.

The ability to add multiple files to the database.


Download project:
http://myvisualdatabase.com/forum/misc. … download=1

Переформулирую вопрос: Как сделать добавление файлов по одному, но с выводом списка файлов в грид. Как показано в вашем примере, но в MyVisualDatabase 1.46?

я уже ответил )
просто удалите скрипт, возможность добавлять файлы по одному и вывод их в грид реализуется без скриптов.


Да, ссылки на сайты должны быть расположены на форме.

расположите на форму компонент Label, в качестве текста введите желаемую ссылку, затем создайте событие OnClick для данного компонента:

procedure Form1_Label1_OnClick (Sender: string);
begin
    OpenURL(Form1.Label1.Caption);
end;

а чтобы надпись была более похожа на ссылку, измените ее цвет на синий, а шрифт установите с подчеркиванием.
Также можно изменить курсор компонента, например в событии главной формы OnShow

Form1.Label1.Cursor := crHandPoint; 

А можно ли сделать в версии 1.46 добавление файлов по одному, но чтобы показывался список, и в одну папку как в вашем примере?
Пускай будет по одному)

можно, просто удалите кнопку "Add many files" и удалите скрипт, только в конце оставьте последний пустой блок

begin

end.

P.S. скачал бетку 1.52 по ссылке выше
как сделать ссылку на сайт?

имеете ввиду ссылку на форме?

alibek.karataev wrote:

1.52 Бета.  Скачал по Вашей ссылке
Ошибка: Undeclared identifier: 'Files' at 42:30
__________________________________________

А подобное можно сделать в 1.46? Итоговая программа должна дальше использоваться преподавателем, а вот денег совсем нуль((



если данная ошибка возникает, значит вы используете не последнюю бета версию, и в принципе добавление сразу нескольких файлов в базу не должно работать. (кнопка "Add many files")
возможно вы добавляете файлы через кнопку "Add one file" ? но тогда за раз вы можете добавить только один файл.


к сожалению данный скрипт не будет работать даже в версии 1.51, не говоря про 1.46

7,099

(2 replies, posted in General)

Hello,


You can extend columns using mouse.


or using this script, let's say you have three columns:

procedure Form1_TableGrid1_OnChange (Sender: string);
begin
    Form1.TableGrid1.Columns[0].Options := Form1.TableGrid1.Columns[0].Options + coAutoSize;
    Form1.TableGrid1.Columns[1].Options := Form1.TableGrid1.Columns[1].Options + coAutoSize;
    Form1.TableGrid1.Columns[2].Options := Form1.TableGrid1.Columns[2].Options + coAutoSize;
end;


Also you can enable auto fit columns width, depending on their content, example:

procedure Form1_TableGrid1_OnChange (Sender: string);
begin
   Form1.TableGrid1.BestFitColumns(bfBoth);
end;

tcoton
Forgot to remove some code for test, please download the example again.