-
MY PROJECTS
-
Recent Posts
- SQL.How can you compare two nullable values safely, and how does IS DISTINCT FROM differ from <>?
- SQL.How are NULL values ordered by ORDER BY, how do defaults differ between databases, and how can you control their placement?
- SQL.How does NULL propagate through arithmetic expressions, and how can COALESCE and NULLIF help handle missing values and division by zero?
- SQL.How does NULL affect join conditions, and why can filtering the right-hand table in WHERE remove unmatched rows from a LEFT JOIN?
- SQL.How do GROUP BY and DISTINCT treat NULL values, even though NULL = NULL evaluates to UNKNOWN?
- SQL.How do aggregate functions handle NULL, and what is the difference between COUNT(*), COUNT(column), and COUNT(DISTINCT column)?
- SQL.How does NULL affect IN and NOT IN, and why can NOT EXISTS be a safer choice when a subquery returns nullable values?
- SQL.How do WHERE, HAVING, and CHECK constraints treat conditions that evaluate to UNKNOWN?
- SQL.Why do column = NULL and column <> NULL not work as expected, and when should you use IS NULL and IS NOT NULL?
- SQL.What is SQL’s three-valued logic (TRUE, FALSE, UNKNOWN), and how do AND, OR, and NOT behave with UNKNOWN?
- ChromeDevTools.Watch all failed requests
- SQL.What are domain types (or constraints on data types), and how do they help enforce data correctness?
- SQL.How does SQL handle comparisons between different data types (for example, string vs number), and why is this dangerous?
- SQL.What is the difference between DATE, TIME, TIMESTAMP, and TIMESTAMPTZ, and which one should be used for business events?
- SQL.How do numeric types like INTEGER, BIGINT, DECIMAL, and FLOAT differ in terms of precision and use cases?
- SQL.What problems can arise from implicit type casting in SQL, and how can it affect indexes?
- SQL.How does NULL differ from 0, an empty string, or FALSE in SQL?
- SQL.What is the difference between CHAR, VARCHAR, and TEXT, and when would you choose each?
- SQL.What is MVCC ?
- SQL.What is AutoVacuum Postgres ?
Categories
- Aptana
- Azure
- C#
- DataSnap
- DBExpress
- Delphi
- Delphi и сети
- Delphi. Язык программирования
- ExtJS
- FastReport
- FireDAC
- FireMonkey
- GIT
- ICS
- IDE
- IIS
- Indy
- InnoSetup
- javascript
- jQuery
- JSON
- LiveBindings
- MSHTML
- MySQL
- PHP
- REST
- Ribbons
- SMS
- SQL инструкции
- SVN
- TRichView
- UniGui
- WebBroker
- WinAPI
- Windows
- Алгоритмы
- Без рубрики
- Деревья
- Ищу ответ
- Компонентостроение
- Мои компоненты
- Начальный уровень
- Обработка исключений
- Парсинг
- Потоки(Threads)
- Регулярные выражения
- Тестирование приложений
Category Archives: FireMonkey
MessageDlg – запрос сохранения данных в Memo
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
var textModified:boolean; procedure TForm2.FormCloseQuery(Sender: TObject; var CanClose: Boolean); begin if textModified then case MessageDlg('Сохранить изменения в тексте',TMsgDlgType.mtConfirmation, [tMsgDlgBtn.mbYes]+[tMsgDlgBtn.mbNo]+[tMsgDlgBtn.mbCancel],-1) of mrYes: memo1.Lines.SaveToFile('saved.txt'); mrNO: CanClose:=true; mrCancel: CanClose:=true; end end; |
Posted in Delphi, FireMonkey, Без рубрики
Comments Off on MessageDlg – запрос сохранения данных в Memo
Modal_Forms
В порядке практики… Создадим 2 формы, главная форма будет вызывать не главную через showmodal… Вызов модальной формы
|
1 2 3 4 |
procedure TForm1.Button3Click(Sender: TObject); begin Form2.ShowModal; end; |
Чтение модального результата
|
1 2 3 4 5 6 7 |
procedure TForm1.Button4Click(Sender: TObject); begin if Form2.ModalResult = mrCancel then Showmessage('Result Cancel'); if Form2.ModalResult = mrOk then Showmessage('Result Ok'); end; |
На модальной форме есть кнопка, которая записывает в свойство ModalResult значение mrOK при событии onClick
|
1 |
Self.ModalResult:=mrOk; |
Также, если … Continue reading
Posted in Delphi, FireMonkey, Без рубрики
Comments Off on Modal_Forms
Application.LastKeyPress and Application.LastUserActive
Нашел такие свойства у Application
|
1 2 3 4 5 6 7 8 9 10 11 |
procedure TForm1.Button1Click(Sender: TObject); begin edit1.Text:=''; edit1.Text:=DateTimeTostr(application.LastKeyPress); end; procedure TForm1.Button2Click(Sender: TObject); begin edit1.Text:=''; edit1.Text:=DateTimeTostr(application.LastUserActive); end; |
Posted in Delphi, FireMonkey
Comments Off on Application.LastKeyPress and Application.LastUserActive
Errors_logging
FireMonkey. Логирование ошибок в файл
|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 |
program Project1; uses System.StartUpCopy, FMX.Forms, System.IOUtils, System.SysUtils, Unit2 in 'Unit2.pas' {Form2}; type TAppErrors=class procedure ErrorLog(Sender:Tobject;E:Exception); end; {$R *.res} { TAppErrors } procedure TAppErrors.ErrorLog(Sender: Tobject; E: Exception); var s:string; begin s:=Format('%s'+#9+'%s',[DateTimeToStr(Now),E.Message]); TFile.AppendAllText('errors.log',s+#10#13); Application.ShowException(E); end; var AppError:TAppErrors; begin AppError:=TAppErrors.Create; Application.OnException:=AppError.ErrorLog; Application.Initialize; Application.CreateForm(TForm2, Form2); Application.Run; end. |
Posted in Delphi, FireMonkey
Comments Off on Errors_logging
Метод PaintTo
Любой потомок TControl умеет рисовать на Canvas других элементов методом PaintTo Нарисуем кнопку в левом верхнем углу формы. По нажатию на Button1 происходит прорисовка.
|
1 2 3 4 5 6 |
procedure TForm2.Button1Click(Sender: TObject); begin Form2.Canvas.BeginScene; Button1.PaintTo(Form2.Canvas,RectF(0,0,Button1.Width,button1.Height)); Form2.Canvas.EndScene; end; |
Posted in Delphi, FireMonkey
Comments Off on Метод PaintTo
Перемещение мышью TControl (на примере кнопки)
Пример из Д. Осипова Объявляем глобальные переменные
|
1 2 3 4 |
var Form2: TForm2; xOffset:single; yOffset:single; |
Фиксируем начальную точку
|
1 2 3 4 5 6 |
procedure TForm2.Button1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Single); begin xoffset:=x; yoffset:=y; end; |
Перемещаем
|
1 2 3 4 5 6 7 8 9 10 11 12 13 |
procedure TForm2.Button1MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Single); begin if (ssLeft in Shift) then with (sender as tcontrol) do begin button1.Position.X:=button1.Position.x+x-xoffset; button1.Position.y:=button1.Position.Y+Y-yoffset; end; end; |
Posted in Delphi, FireMonkey, Без рубрики
Comments Off on Перемещение мышью TControl (на примере кнопки)
Калькулятор (частично)
Частично восстанавливаю пример калькулятора по Д.Осипову. Основная особенность – присвоить 1 событие нажатия на кнопку, соответствующую цифре для всех кнопок (1-9);
|
1 2 3 4 5 6 7 |
procedure TForm2.CornerButton1Click(Sender: TObject); begin if Label1.Text='0' then label1.Text:=(sender as tcornerbutton).Text else label1.Text:=label1.Text+(Sender as tcornerbutton).Text; end; |
Posted in Delphi, FireMonkey, Без рубрики
Comments Off on Калькулятор (частично)
Delphi.Generics types
В данном посте разбираюсь с обобщенными типами данных, руководствуясь книгой Д. Осипова “Delphi. Программирование для Windows. OS X, iOS и Android”. Цель – отработать на практике возможности обобщенных типов. Зачем нужны обобщенные типы? Насколько я понял, в том числе для … Continue reading
Posted in Delphi, Delphi. Язык программирования, FireMonkey, Без рубрики
Comments Off on Delphi.Generics types