К сожалению получить дату файла нет возможности. Почему бы просто не разместить текстовый файл с номером версии и проверять его содержимое?



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

3,252

(7 replies, posted in FAQ)

Own icons for buttons


var
    ImageList: TImageList;


begin
  // create new ImageList
  ImageList:=TImageList.Create(Form1);
  ImageList.Masked:=false;
  ImageList.ColorDepth:=cd32bit;
  // size of images                 
  ImageList.Width := 16;
  ImageList.Height := 16;

  // load images
  ImageList.AddPng(ExtractFilePath(Application.ExeName)+'Icons\key.png');      // 0 - index if image
  ImageList.AddPng(ExtractFilePath(Application.ExeName)+'Icons\accept.png');   // 1
  ImageList.AddPng(ExtractFilePath(Application.ExeName)+'Icons\link.png');     // 2
  ImageList.AddPng(ExtractFilePath(Application.ExeName)+'Icons\window.png');   // 3

  // Change ImageList for buttons
  Form1.Button1.Images := ImageList;
  Form1.Button2.Images := ImageList;
  Form1.Button3.Images := ImageList;
  Form1.Button4.Images := ImageList;
  Form1.Button5.Images := ImageList;
  Form1.Button6.Images := ImageList;

  // Select images for buttons
  Form1.Button1.ImageIndex := 0;
  Form1.Button2.ImageIndex := 1;
  Form1.Button3.ImageIndex := 2;
  Form1.Button4.ImageIndex := 3;
  Form1.Button5.ImageIndex := 3;
  Form1.Button6.ImageIndex := 3;
end.

Project example:

3,253

(7 replies, posted in Russian)

1. Создать меню можно и в секции begin end. которая расположена в самом конце скрипта, т.о. избежав использование события OnShow, пример

var
   MyItem1: TMenuItem;
   MyItem2: TMenuItem;
   MySubItem3: TMenuItem;


procedure MenuClick1 (Sender: string);
begin
     ShowMessage('Hello from MyItem1');
end;

procedure MenuClick3 (Sender: string);
begin
     ShowMessage('Hello from subitem');
end;

begin
   MyItem1 := TMenuItem.Create (Form1.MainMenu);
   MyItem1.Caption := 'Item1';
   MyItem1.OnClick := @MenuClick1;

   MyItem2 := TMenuItem.Create (Form1.MainMenu);
   MyItem2.Caption := 'Item2';


   MySubItem3 := TMenuItem.Create (Form1.MainMenu);
   MySubItem3.Caption := 'Submenu';
   MySubItem3.OnClick := @MenuClick3;

   Form1.mniFile.Insert(0, MyItem1);
   Form1.MainMenu.Items.Insert(0, MyItem2);
   MyItem2.Add(MySubItem3);
end.

2. К сожалению не понял вопроса, расскажите пожалуйста подробней.


3. Добавил такую возможность в последнюю бета версию
https://www.dropbox.com/s/f3j4kfpnttm1o … b.zip?dl=0

Пример: http://myvisualdatabase.com/forum/viewt … ?pid=20913

Загрузка собственных иконок на кнопки


var
    ImageList: TImageList;

begin
  // создаем компонент ImageList
  ImageList:=TImageList.Create(Form1);
  ImageList.Masked:=false;
  ImageList.ColorDepth:=cd32bit;
  // size of images                 
  ImageList.Width := 16;
  ImageList.Height := 16;

  // загрузка иконов в ImageList
  ImageList.AddPng(ExtractFilePath(Application.ExeName)+'Icons\key.png');      // 0 - номер иконки
  ImageList.AddPng(ExtractFilePath(Application.ExeName)+'Icons\accept.png');   // 1
  ImageList.AddPng(ExtractFilePath(Application.ExeName)+'Icons\link.png');     // 2
  ImageList.AddPng(ExtractFilePath(Application.ExeName)+'Icons\window.png');   // 3

  // Присваиваем ImageList для кнопок
  Form1.Button1.Images := ImageList;
  Form1.Button2.Images := ImageList;
  Form1.Button3.Images := ImageList;
  Form1.Button4.Images := ImageList;
  Form1.Button5.Images := ImageList;
  Form1.Button6.Images := ImageList;

  // Выбираем номер иконки для кнопок
  Form1.Button1.ImageIndex := 0;
  Form1.Button2.ImageIndex := 1;
  Form1.Button3.ImageIndex := 2;
  Form1.Button4.ImageIndex := 3;
  Form1.Button5.ImageIndex := 3;
  Form1.Button6.ImageIndex := 3;
end.


Проект с примером:

3,255

(7 replies, posted in Russian)

Прошу прощения за задержку с ответом.


Так можно задать самостоятельно позицию окна просмотра изображения

procedure Form2_DBImage1_OnClick (Sender: string);
begin
   frmdbCoreImageViewer.Position := poDesigned;
   frmdbCoreImageViewer.Top := 0;
   frmdbCoreImageViewer.Left := 0;
end;

3,256

(2 replies, posted in General)

An example

Здравствуйте.


Прощу прощения за задержку с ответом, был в отпуске. Вопрос все еще актуален для Вас?

3,258

(11 replies, posted in Russian)

Пример

procedure Form1_Button1_OnClick (Sender: string; var Cancel: boolean);
begin
    Form1.Edit1.Clear;
    Form1.ComboBox1.dbItemID := -1;
    Form1.DateTimePicker1.Checked := False;
end;

Все правильно, по другому и не сделать.

3,260

(2 replies, posted in Russian)

Здравствуйте.


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

К сожалению нет возможности использовать пользовательные функции в SQL запросах.
Вы можете с помощью цикла пройтись по всем записям друг за другом для их преобразования.

Здравствуйте.


Прощу прощения за задержку с ответом, был в отпуске. Вопрос все еще актуален для Вас?

Здравствуйте.


Прощу прощения за задержку с ответом, был в отпуске. Вопрос все еще актуален для Вас?

Please provide more details with a example.

3,265

(1 replies, posted in Script)

Hello.


The function RemoveDir removes only empty folder, if you want remove all files and sub folders, you can use this script:


function DeleteDirWithFiles(dir: string): boolean;
var
    sl: TStringList;
    i,c: integer;
begin
    result := True;
    sl := TStringList.Create;
    sl.Text := GetFilesList(dir);

    // delete all files
    c := sl.Count-1;
    for i := 0 to c do
        if not DeleteFile(sl[i]) then
        begin
            ShowMessage('Can''t remove file '+sl[i]);
            result := False;
        end;

    // delete directiries
    sl.Text := GetDirectories(dir);
    c := sl.Count-1;
    for i := c downto 0 do
        if not RemoveDir(sl[i]) then
        begin
            ShowMessage('Can''t remove dirercory '+sl[i]);
            result := False;
        end;

    // delete main directory
    RemoveDir(dir);
    sl.Free;
end;


// how to use function DeleteDirWithFiles
procedure Form1_Button4_OnClick (Sender: string; var Cancel: boolean);
var
    sDir: string;
begin
    sDir := 'd:\folder';

    if not DeleteDirWithFiles(sDir) then
        ShowMessage('Can''t remove directory');
end;

3,266

(7 replies, posted in General)

Hello.


Your project placed in the folder "F:\Application\Bases\Fleurs sauvages\tmp" ?
Can you also attach your project and screenshot of error message.

3,267

(2 replies, posted in General)

Hello.


Sorry for delay.


An example for you:

3,268

(1 replies, posted in General)

Sorry for delay, I was on vacation. The question still actual for you?
Also please provide more details about your question.

Извиняюсь за задержку с ответом, был в отпуске.
Вопрос все еще актуален для вас?

An example for you:
http://myvisualdatabase.com/forum/misc. … download=1

Bolat

Думаю грид с типами двигателей на форме frm_WS_FLEET не нужен. Сделал небольшой скрипт, чтобы показывалось двигатель и его тип.


Также на форму Form1 добавил кнопку "Наработка", где можете ввести рейс, дату и наработку двигателя.

3,272

(3 replies, posted in General)

You can remove file script.pas to protect your script against changes by users, for works your project enough file script.dcu

3,273

(2 replies, posted in General)

Hello.


If a picture saved in database, you don't need any script to display it in the report.
Please attach your project.

3,274

(2 replies, posted in General)

Hello.



    CompressDirectory('d:\folder', 'd:\file.zlib');
    DecompressFiles('d:\file.zlib', 'd:\');

3,275

(25 replies, posted in General)

You can create a shortcut for GetShot.exe file and set properties of shortcut  to run file in minimized mode.


OpenFile('/delay '+k+' /width '+i+' /height '+j+' /bmp','GetShot.lnk');