1

(11 replies, posted in Russian)

Привет Vickus!
Просто измените строку 3 в скрипте.
В приложенном примере теперь используется значение из Frm_add.combobox1.text, и, начиная с позиции 1, первые два символа, за которыми следует знак «-» (но, конечно, вы можете использовать любое количество символов и изменить формат по своему усмотрению).
Я также изменил скрипт так, чтобы это происходило при сохранении записи, а не при выборе значения из выпадающего списка «Категория» (это сделано для того, чтобы уменьшить вероятность одновременных операций (если у вас несколько пользователей), как упоминал K245).
Надеюсь, это поможет.
Derek.

2

(11 replies, posted in Russian)

Привет, Викус!
Если я правильно понял твой вопрос, то можно попробовать что-то вроде этого (с этим решением тебе не придётся «жёстко прописывать» категории, так что можно просто добавить новые, и счётчик автоматически начнёт отсчёт с 10 000 для каждой новой категории).
С уважением,
Derek.
.
If I understand your question correctly, you can try something like this (with this solution you don't have to "hardcode" the categories, so you can just add new ones and the counter will automatically start counting from 10,000 for each new category).

Вы неправильно настроили кнопку (см. скриншот).
Вместо этого выберите «New Record».
Derek.

Hi Roberto, Konstantin,
Attached are a couple of suggestions that might help.
1.  Hide Columns Persistent.
With this option, the selection of hidden columns is persistent between sessions. 
Click on the 'Columns' button and then click on the columns in the 'pop-up' grid that you want to hide / unhide (highlighted with an 'x') and then click on the 'Columns' button again.
2.  Re-sort Columns Persistent.
With this option, the order of the columns in the tablegrid is persistent between sessions.
Click on the 'Columns' button and then 'drag and drop' the columns in the 'pop-up' grid in whatever order you want.  When they are in the order that you want, click on the 'Columns' button again to re-sort the tablegrid.
Maybe this can give you some ideas.
Regards,
Derek.

Привет!
Попробуйте что-то вроде этого (см. приложение).
Имена пользователей и пароли:
admin / admin
lejetix / lejetix
С уважением,
Derek.

6

(9 replies, posted in Script)

Hi FMR,
If you use 'Styles', then this is just a single line of code in the script to change the colour (thanks to Sparrow for this tip).  Have a look at the attachment.
But if you're not using 'Styles', I don't know of any way that this can be easily done (if at all).
Regards,
Derek.

7

(16 replies, posted in General)

Hi Adam, Jean, Sparrow,
I was having a think about this project of Adam's and wanted to see how far you could get with (almost big_smile) no script).
Have a look at the attached as a possibility.
Click on the combobox to select an icon and then simply click in the first column of however many rows you want to highlight (change the combobox selection for a different icon etc or choose the first empty row of the combobox to remove any highlighting).
Advantages
1.  very small script
2.  nothing is hard coded so new icons can simply be added by clicking on the 'configuration' button on Form1 which makes it pretty flexible.
Disadvantages
1.  although it is still a 'tree', you lose the vertical and horizontal lines that better display the child nodes.
Maybe someone will find the approach useful.
Regards,
D.

8

(2 replies, posted in Russian)

Привет Sacha,
Я изменил код вашего вычисляемого поля, чтобы отображались правильные значения.
Однако это не главная проблема.
Связи между таблицей "culinary_product" и таблицами "stocks" и "product" не поддерживаются автоматически из-за того, как вы создали свое приложение.
Посмотрите на "screenshot" во вложении, который показывает, как хранятся ваши данные.
* Я вручную добавил связи для первых двух записей (чтобы "вычисляемое поле" отображалось правильно).
* Затем я добавил третью запись ("curry"), и это показывает, что связи "null".
Вам нужно исправить это, прежде чем вы сможете добиться какого-либо прогресса.
С уважением,
Derek.

9

(16 replies, posted in General)

Blame it on old age!  Or I might have uploaded the wrong thing and then quickly deleted it.
Either way, download this attachment to make sure you've got the right thing.
When you run it, just click on the '⚫' to toggle highlighting.
Derek.

10

(16 replies, posted in General)

Hi Adam, Salut Jean,
Ça va ? Il fait très chaud en France en ce moment, je pense! Reste cool!  cool
I'm guessing that you just want to use an icon as a toggle - simply click it to mark a node in the tree as requiring attention and then click the icon again when you're done with it.
I just used unicode symbols rather than true 'icons' as I always like to keep the scripts as short as possible.
Maybe try something like the attached (I've used 'color' to highlight nodes rather than 'bold' but the principle is the same).
Regards,
Derek.

11

(16 replies, posted in General)

Hi Adam,
Try doing it something like the attached (I went with 'colour boxes' in the end rather than a button or a right-click).  It just seemed more intuitive.
But if you have a large number of colour options rather than just a few, maybe use a combobox instead (the same logic applies).
Regards,
Derek.

12

(16 replies, posted in General)

Hi Adam,
How's it going?
Would it be enough just to change the treeview grid properties?
Specifically,
1.  remove the tick from Additional / AppearanceOptions / aoalphablendedselection
2.  add tick to Additional / AppearanceOptions / aoboldtextselection
3.  change Additional / HighlightedTextColor to (whatever you want)
4.  optionally, remove tick from Additional / Options / GoSelectFullRow (so only a single cell is highlighted rather than the full row).
Nice and simple, no script required.
Not sure why you'd want to have this on a button or a right-click rather than just clicking on the cell.  However, if you do need to do it that way, try adding this code (or something like)

procedure Form1_Button4_OnClick (Sender: TObject; var Cancel: boolean);
var  vi, vr: integer;
begin
  vr := form1.treeview1.SelectedRow;                          //** make a note of which row has been highlighted
  form1.treeview1.dbupdate;                                   //** re-set the tree (remove colour and bold attributes)
  for vi := 0 to form1.TreeView1.RowCount-1 do                //** cycle through the grid
    begin
      if form1.treeview1.SelectedRow = vr then                //** if row matches the highlighted row
        begin
          form1.TreeView1.cell[0,vr].textcolor := clred;      //** set colour
          form1.TreeView1.cell[0,vr].FontStyle := fsbold;     //** set bold
        end;
    end;
end;

See attached (one of your old projects).
Derek.

13

(6 replies, posted in SQL queries)

Hi Agusecc,
Jean and I did some work a couple of years ago on a CashBook (Running Balance) application.
Attached is a cut down version of it that might be useful.
There is probably a link to Jean's fully featured application if you search on the Forum for it.
As Sparrow has mentioned, make sure you have defined your transaction date as date/time and not just date or your 'running balance' calculation can get messed up if you have multiple transactions on the same day.
Regards,
Derek.

14

(2 replies, posted in Script)

Hi FMR,
Not sure I understand what you mean by 'sqlite copy problem', but to prevent multiple users logging on, bascially you could try something like this (see attached).
Login details
admin / admin
FMR / fmr
Derek Larsen / derek
Regards,
Derek.

15

(5 replies, posted in General)

Hi Sparrow,
Thanks for the updates - nice.
Instead of using your 'shape' procedure, another option might be to use the existing label (a label will always sit in the background by default) and just alter it's size so that it creates the effect of a border around each object.
Which ever method is used, I think it now highlights each object very well.
Derek.

16

(5 replies, posted in General)

Hi Sparrow,
Thanks for the fix.
I knew about the issue with 'panels' (it's the same for 'group boxes' as well) but they are not used in my application (at the moment!).
Regards,
Derek.

17

(5 replies, posted in General)

Hello Everyone,
I have an application that has a large number of objects on a form.
Because of this, I want to be able to indicate which object has focus to make it more user-friendly.
I have a small script to do this and it works fine except when there is a 'richtext' object which the script does not recognise.
The script currently is written with 'TDbEedit(sender) but it makes no difference if you use 'TRichEdit' (or anything else).
If you 'tab' through the fields on the form in the attached example (or click in any field using the mouse) you will see what the problem is.
Running on MVD 6.5 / SQLite / Windows11.
Does anyone have any ideas?
Thanks,
Derek.

18

(1 replies, posted in Russian)

Привет Vickus,
Несколько способов, которыми вы можете сделать это (см. 2 варианта в приложении).
С уважением,
Derek.

19

(11 replies, posted in General)

Hi Sparrow,
Yes - sometimes the simplest solution is right in front of us and we don't see it - sad
Replacing 'record_count' with you own integer counter solves all of the problems when trying to use it with an editable grid.
Very neat!
Derek.

I would suggest adding an 'expiry date' to your services table and then add a small script to check if any new orders try to use a service that has expired.
This means that old orders that were raised before the service expiry date will still be accessible.
See attached for a basic idea.
Derek.

21

(11 replies, posted in General)

Hi Everyone,
As I understand it, the problem is specific to using a record_count with an editable grid.
When creating a new record using a separate edit form, the record_count is automatically allocated but this doesn't happen when using editable grids (I've tried a few things in conjunction with the 'OnInputAccept' event but can't get it working at the moment).
It's a shame that Dmitry didn't get the time to develop editable grids further as they could be much more useful.
Derek.

22

(9 replies, posted in Reports)

Hi,
Probably a couple of ways to fix your issue but I like to keep things simple (where possible).
See attached.
Derek.

23

(11 replies, posted in General)

It should work as designed.
If you attach your project, maybe we can understand what is going wrong.
Derek.

24

(16 replies, posted in General)

Hi Sparrow,
You have excellent eye-sight to spot the ',' instead of '.'!  big_smile
Derek.

25

(16 replies, posted in General)

Hi Igor, Hi Agusecc,
Works perfectly for me - deleted invoices, added new orders / invoices, tested for displaying 9.99, 9.90 and 9.00 and everything appears correct (see attached).
Derek.