I'm playing around with Derek's code a bit.
I can't figure out how to write the script to hide a TabSheet, using "Visible=False" method.
I'll post the code but it's definitely wrong.
1 2024-06-25 20:09:40
Re: Open new page of a Page Control for New Record (13 replies, posted in FAQ)
2 2024-05-19 06:04:52
Re: myproject_5 (4 replies, posted in General)
How to open??
это от другой программы
this is from another program
4 2024-05-17 04:30:58
Re: Counter for the elapsed time (13 replies, posted in General)
не понимаю зачем вам даты и зачем вы пытаетесь преобразовывать минуты.
var
time:TDateTime;
timer:TTimer;
time2:TDateTime = StrToDateTime('00:00:01');
procedure Form1_OnShow (Sender: TObject; Action: string);
begin
Form1.ComboBox1.Items.Add('30 minutes');
Form1.ComboBox1.Items.Add('60 minutes');
Form1.ComboBox1.Items.Add('90 minutes');
Form1.ComboBox1.Items.Add('120 minutes');
end;
procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
CASE Form1.ComboBox1.ItemIndex OF
0: time := StrToTime('00:30:00');
1: time := StrToTime('01:00:00');
2: time := StrToTime('01:30:00');
3: time := StrToTime('02:00:00');
end;
timer:=TTimer.Create(form1);
timer.Interval := 1000;
timer.OnTimer := @timego;
timer.Enabled := True;
end;
procedure timego;
begin
time := time-time2;
Form1.Edit1.Text := TimeToStr(time);
end;
и второй вариант
var
time:TDateTime;
timer:TTimer;
time2:TDateTime = StrToDateTime('00:00:01');
procedure Form1_OnShow (Sender: TObject; Action: string);
begin
if (SQLExecute('SELECT COUNT(id) FROM time') = 0) then
begin
SQLExecute('INSERT INTO time(name,time)VALUES("30 minutes","00:30:00")'+
',("60 minutes","01:00:00"),("90 minutes","01:30:00"),("120 minutes","02:00:00")');
UPDATEDATABASE('time');
end;
end;
procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
time := SQLDateTimeToDateTime(SQLExecute('SELECT time FROM time WHERE id='+Form1.ComboBox1.sqlValue));
timer:=TTimer.Create(form1);
timer.Interval := 1000;
timer.OnTimer := @timego;
timer.Enabled := True;
end;
procedure timego;
begin
time := time-time2;
Form1.Edit1.Text := TimeToStr(time);
end;
5 2024-05-15 19:46:28
Re: Counter for the elapsed time (13 replies, posted in General)
Dear Vladimir,
Thank you for your solution.
I still need some advice to implement this one.
I have a textbox where I will enter minutes.
I want to add the currentdateTime + textbox.text and assign them to datetimepicker2 (according your example) and only then to run the start button.
How can I convert text value into time and assign it to the textbox and then to make the calculation?Thank you once again for your help.
BR,
Alin
6 2024-05-15 13:44:03
Re: Призраки My Visual Database (4 replies, posted in Russian)
Получается автор и не собирался этот компонент использовать, но видимо он с чем-то подтянулся? или случайно обрубил обработчика ?
7 2024-05-15 13:30:18
Re: Призраки My Visual Database (4 replies, posted in Russian)
может все таки кто-то сработает
property OnChange: TNotifyEvent;
Event handler signalled when the Position in the control has been changed.
property OnChangeBounds: TNotifyEvent;
Event handler signalled when the Bounds for the control have been changed.
property OnClick: TNotifyEvent;
Notification handler for mouse clicks.
property OnContextPopup: TContextPopupEvent;
Invoked when a context-sensitive pop-up menu is requested.
property OnDragDrop: TDragDropEvent;
Event handler signalled when an object is dropped onto the control.
property OnDragOver: TDragOverEvent;
Event handler signalled when a control is dragged over the control instance.
property OnEndDrag: TEndDragEvent;
Event handler signalled for the end of a drag-drop operation.
property OnEnter: TNotifyEvent;
Event handler signalled when the control receives focus.
property OnExit: TNotifyEvent;
Event handler signalled when the control loses focus.
property OnMouseDown: TMouseEvent;
Event handler signalled when a mouse down event is handled for the control.
property OnMouseEnter: TNotifyEvent;
Event handler signalled when the mouse pointer has entered the control.
property OnMouseLeave: TNotifyEvent;
Event handler signalled when the mouse pointer has left the control.
property OnMouseMove: TMouseMoveEvent;
Event handler signalled when the mouse pointer is moved in the control.
property OnMouseUp: TMouseEvent;
Event handler signalled when a mouse up event is handled for the control.
property OnMouseWheel: TMouseWheelEvent;
Event handler for mouse wheel turned.
property OnMouseWheelDown: TMouseWheelUpDownEvent;
Event handler signalled for a downward movement of the mouse wheel.
property OnMouseWheelUp: TMouseWheelUpDownEvent;
Event handler signalled for an upward movement of the mouse wheel.
property OnMouseWheelHorz: TMouseWheelEvent;
Event handler signalled for a horizontal movement of the mouse wheel.
property OnMouseWheelLeft: TMouseWheelUpDownEvent;
Event handler signalled for a leftward movement of the mouse wheel.
property OnMouseWheelRight: TMouseWheelUpDownEvent;
Event handler signalled for a rightward movement of the mouse wheel.
property OnKeyDown: TKeyEvent;
Event handler signalled for key down keyboard events.
property OnKeyPress: TKeyPressEvent;
Event handler signalled for character data entered by the user.
property OnKeyUp: TKeyEvent;
Event handler signalled when a key up event has occurred for the control.
property OnResize: TNotifyEvent;
Notification handler for a resize of the control.
property OnStartDrag: TStartDragEvent;
Event handler signalled for the start of a dragging operation.
property OnUTF8KeyPress: TUTF8KeyPressEvent;
8 2024-05-13 19:51:08
Re: Counter for the elapsed time (13 replies, posted in General)
var
time:TDateTime;
timer:TTimer;
time2:TDateTime = StrToDateTime('00:00:01');
procedure Form1_Button1_OnClick (Sender: TObject; var Cancel: boolean);
begin
time := Form1.DateTimePicker2.Time - Form1.DateTimePicker1.Time;
timer:=TTimer.Create(form1);
timer.Interval := 1000;
timer.OnTimer := @timego;
timer.Enabled := True;
end;
procedure timego;
begin
time := time-time2;
Form1.Time.Caption := TimeToStr(time);
end;
9 2024-05-13 19:19:25
Re: проект автоматизации Столовой (общепит) (2 replies, posted in Database applications)
Господа! Может кто-то имеет наброски проекта автоматизации работы общепитовской столовой?
что ты хочешь? кассу? приложение по заказам? сам как видишь это? это просто приложение в котором нужно зафиксировать продажу товара?
11 2024-04-17 12:13:53
Re: Фильтр для TGrid (5 replies, posted in Russian)
что значит sostav_2 ?
для чего эта таблица??
12 2024-04-17 11:20:05
Re: incompatible Value (5 replies, posted in Script)
viii,myvalue : integer;
var viii: integer;
13 2024-04-17 11:16:31
Re: фокус - в чем причина? | focus - what's the reason? (2 replies, posted in Russian)
FOOD
14 2024-04-17 11:10:10
Topic: фокус - в чем причина? | focus - what's the reason? (2 replies, posted in Russian)
15 2024-04-14 14:17:42
Re: Вычисляемые поля в MySQL (5 replies, posted in Russian)
Вынуть дату из БД
myDate : TDateTime = SQLDateTimeToDateTime();
потом можете их как угодно арифметить
Case When oformlen = 1
THEN '+' ELSE ''
END
в данном варианте вроди как не заменяется символ, а создается поле
16 2024-04-06 11:30:48
Re: Помощь 4 в проекте для Новичка (8 replies, posted in Russian)
[*]При создании новой записи, в поле выбора КАТАЛОГА (ComboBox1) необходимо вывести последнее из сохраненных значений[/*]
последняя запись всегда имеет маскимальное значение ID
SELECT MAX(....)
17 2024-03-29 11:08:05
Re: Dmitry Required (18 replies, posted in General)
Он должен вернуться, просто он немного перегорел. Вполне возможно, что именно сейчас он создает новый конструктор
18 2024-03-24 09:38:29
Re: Сохранение в зависимости от выбора Combobox (11 replies, posted in Russian)
И снова здравствуйте, может кто сталкивался, и расскажет как поправить, после поиска поле расход в таблице успешно превращается в нули.
С верху до поиска,
С низу после
НУЖЕН ВАШ ПРОЕКТ
20 2024-03-10 12:50:44
Re: Cascade Delete Bug (4 replies, posted in General)
Thanks for the reply
I know that I can choose not to use cascade.
I have attached a sample.
suppose you record something wrong in a (combobox1 Mainform) and you want to delete it while keeping other data.
If I don't use cascade delete then I get an error
If I use cascade delete all the data are lost.
What I need to do is that when I delete the data in (Tablegrid1 Bank) other data that are recorded should be intact and only the data of (combobox1 Mainform) should be cleared.
Do you think it can be done using a script?
thanks a lot
А Вам и не нужно ни чего удалять, просто перейдите в редактирование записи и в ComboBox выберете пустое поле, нажмите сохранить
And you don’t need to delete anything, just go to edit the entry and select an empty field in the ComboBox, click save
21 2024-03-10 12:01:52
Re: problem in date (my first project) (10 replies, posted in General)
hi everyone
i am new to the app and i am trying some concept . i use a table called tempx that have a date filed , and when i chose a date from date time picker and click save button the date stored in table but i have two problems
if i chose the same date it will store it again and i don't want this , i try to use sql but i have to change the date to string and i don't want that , is there a solution for this ??
second think i want to save each row in tempx date to other table with some other info, how to do this ???i have attached the program ....
procedure Form1_Button2_OnClick (Sender: TObject; var Cancel: boolean);
begin
if ( SQLExecute('SELECT COUNT(id) FROM tempx WHERE Date='+ Form1.DateTimePicker1.sqlDateTime) <> 0) then Cancel := True;
end;
22 2024-03-09 07:37:16
Re: Помощь в проекте для Новичка (2 replies, posted in Russian)
Здравствуйте.
Помогите мне с проектом.
При заполнении поля КЛЮЧ(Edit1) как сделать, что бы данные из базы данных подтягивались в поле Имя (Edit2)
Проект прилагаю.
procedure Form1_Edit1_OnChange (Sender: TObject);
begin
if (Form1.Edit1.Text <> '') then
Form1.Edit2.Text := SQLExecute('SELECT user_name FROM user_log WHERE user_key='''+Form1.Edit1.Text+'''') else
Form1.Edit1.Text := '';
end;
23 2024-03-04 17:47:07
Re: помогите с проектом (9 replies, posted in Russian)
в общем такая проблема не могу сделать поиск по комплектующим и там еще есть поле где ставится дата когда товар был приобретен не сохраняет данные тоже спасибо за понимания и помощь заранее благодарен...
опишите точнее
24 2024-02-22 18:11:10
Re: Linking to tree node (1 replies, posted in General)
I was wandering if there is a way to link (hyperlink) a word in RTF editor to a tree node?
нужно искать на форуме, несколько лет назад я уже задовал такой вопрос Дмирию.
you need to search on the forum, several years ago I already asked this question to Dmitry.