1,901

(15 replies, posted in General)

Hello Again David,
I think the bar type of gauge you mention is a much better idea and then change the size of the indicator interactively.
I had a quick stab at mocking something up based on my previous post (please see attached) - if I'd had a bit more time I think it would look a bit more polished but the principle seems sound enough.
Regards,
Derek

1,902

(1 replies, posted in General)

Hi,
I think the easiest way is either
1.  change the object properties of the edit field to 'currency' and an 'accuracy' of 2 or 3 decimal places, depending on how accurate you want it (please see the attached example and screenshot); 
2.  initially define 'liters' in your data structure as currency to 2 or 3 decimal places.
Which way you choose depends on what best suits your application.
In both instances, it's important to remember that 'currency' is not actually a data type;  it is simply a 'real' data type with some formatting applied to it - the underlying data type ('real') doesn't get changed.
Derek.

1,903

(15 replies, posted in General)

Hi David,
Just came across your post about gauge chart types.
I know it's not what you're really after but until something like tgauge gets implemented, perhaps you could use an image of a gauge.
As the gauge only shows a single series value,  you could then place the discrete values into a label and superimpose it on the image (I appreciate it's not truly 'interactive' like tgauge would be but it might suffice as a temporary fix).
Just a thought.
Regards,
Derek.

Привет, Олег,
Возможно, прилагаемая программа поможет вам изменить фильтр на tablegrid2.
Я также добавил фильтр на combobox1 в качестве альтернативы поиску в tablegrid2.
Есть еще несколько способов.
Надеюсь, это поможет.
Regards,
Derek.

1,905

(2 replies, posted in General)

Hi Raheel,
There are a couple of ways.
The simplest is to hard-code a filter on the tablegrid (see screenshot in the attached example) using whatever criteria you want to filter on (in your example, it looks like where rate = 0).
I have shown 3 grids:  all rows (no filter), rows without zero rate (filter where <> 0) and rows with only zero rate (filter = 0) so you can see the different results with filters applied.
Derek.

1,906

(1 replies, posted in General)

Hello Rob,
Please have a look at the attached.
Typically 'translate' is used to display messages in other languages but you can also simply use it to change the message in the same language (as in my example) to something more relevant to your application.
Here's a link to all the other 'default' messages in MVD that can be changed -
http://myvisualdatabase.com/forum/viewt … 387#p22387
Regards,
Derek

1,907

(4 replies, posted in General)

Hello JRGA,
It sounds as if, in the edit field on the form where you are entering your value, you have ticked the 'currency' object property.  If so, then make sure that you also set the 'accuracy' object property to '2'.  If you set the one without setting the other, the value will only show whole numbers.
Alternatively, leave both of these two object properties as their defaults ('unticked' and 0') and allow the program to use the original definitions that you specified when defining your table.
Hope this is clear and helps,
Derek.

1,908

(1 replies, posted in Script)

Hello Hmlamprecht,
Welcome to MVD - good choice!
The problem you have encountered is probably because you are trying to divide by 0, but it's easy enough to trap it.
Please have a look at the attached to achieve what you want.
Depending on what you want to do, you could also use a calculated field and not need a script at all.
Any questions, just post a message and someone will get back to you.
Regards,
Derek.

1,909

(5 replies, posted in Script)

Hello EHW,
Great - tcolordialog is a much better solution all round for me.  The user can now simply pick their own colours and my script can then work out the integer value for the colour - the user is never exposed to that now.  It's much slicker all round.
Many thanks,
Derek.

1,910

(5 replies, posted in Script)

Hi EHW, JB,
Many thanks for both your responses.
As a work-around, your approach of using an sqlexecute to get the hex value by passing the color constant through from the combobox works well enough for what I need to do, so I'll run with that (although I'll put it into a variable and then just use the variable value as I've got about 20 labels that I need to change color on, so it will be quicker that way). 
I had just wondered if there wasn't a way of doing it DIRECTLY from the color constant (a 'tcolortoint'  command - or something of that sort  LOL!), but I guess not.
Jean - interesting bit of code which I'm trying to understand, but it's always helpful to see new things as they are always useful at some stage.
Regards,
Derek.

1,911

(5 replies, posted in Script)

Hello Dmitry,
I'm trying to change a label color based on a color constant (clred, clblue etc).
If I hard code the color constant in a script, it works fine (for example form1.edit1.font.color := clred;).  however, if I pass the color constant through from a combobox,  it produces a runtime error.
If I select the hex equivalent of a color constant from a combobox it works fine (but users won't know which hex value relates to which color constant).
So the question is how to change a label color to a color constant that is passed from a combobox?  Any ideas?
Thanks,
Derek.

1,912

(3 replies, posted in Script)

Hello Chrisyoco,
Can you attach your project so we can better understand what the problem might be.
Thanks,
Derek.

1,913

(9 replies, posted in General)

Hi Jean,
It sounds like you want a pivot table (like in Excel) but I don't think you can do anything like that very easily - I couldn't work out how to create the extra columns or delete columns depending on the number of rows in your grid.
Instead, perhaps you could use a series of images (I have used 5 in my example) and then scroll through them (so it makes it appear as if they are all in the same row of data);  this eliminates the problem of creating / deleting columns.
Also, instead of using 'hints', I now put a description below each of the scrolling images - perhaps it's better this way?
Anyway, please have a look at the attachment and see if it is of any help to you (the data is not relevant to your project but the principle is the same).
Regards,
Derek.

Hi Again Frank,
I should have mentioned in my previous post that you don't actually need to use a script at all if you prefer not to. 
You could just use a search(filter) button to select a row from tablegrid1 and then place the associated image into tablegrid2 (see attached).
Regards,
Derek.

Hi Frank,
I'd do it this way (please see attached), but there may be other ways too.
Hope this helps,
Derek.

1,916

(73 replies, posted in Russian)

Hello Yuri,
На самом деле это не ошибка, просто сортировка набора символов.
Простое решение (без скрипта) - это создание вычисленного поля, которое делает все значения заглавными и сортирует ваше поле со списком в вычисленном поле. Это не влияет на то, как данные фактически хранятся или отображаются в другом месте.
Возможно, вы можете сделать это так?
Regards,
Derek.

1,917

(5 replies, posted in General)

Hi Dmitry,
Understood and thanks.
Derek.

Hello Karim,
Прикреплены еще два способа достижения желаемого (или комбинации).
Это зависит от того, на что вы считаете, уделяет наибольшее внимание.
Regards,
Derek.

1,919

(9 replies, posted in General)

Hi Jean,
Yes, I did wonder about something like that - perhaps you can do it with hints (click on each image and the hint displays the name of the plane (or in your project, the name of the insect)).

procedure Form1_TableGrid2_OnCellClick (Sender: TObject; ACol, ARow: Integer);
begin
  form1.tablegrid2.hint := sqlexecute('select name from model where id =' +inttostr(form1.tablegrid2.dbitemid)); 
end;
Instead of clicking on each image, I think it would be much better if the hint displayed when the mouse moved over the image but I'm not sure what code you would use for that ('mouseover' works at the tablegrid level rather than at the row or cell level, I believe).
Anyway, here's a link if you want to have a look - https://app.box.com/s/d1psny2z30oilyb78bur6wttotnda7im

Regards,
Derek.

Hello Karim,
Вы можете изменить цвет флажка в WindowsXP - после этого он больше не поддерживается.
Вы можете использовать отдельную метку и поместить ее поверх надписи флажка, а затем сделать ее видимой / невидимой и красной / зеленой.
Возможно, проще изменить form1.label.color вместо этого (см. Приложение)
С Уважением,
Derek.
(с переводчиком google)

1,921

(5 replies, posted in General)

Hello Dmitry,
You mentioned in this post that you plan to introduce some RTF elements for memo edit fields.
Is this feature still being worked on?
Thanks,
Derek.

1,922

(9 replies, posted in General)

Hello Jean,
How are you?
I'm not sure what methods you have already tried but I think I would try it like this (sorry but my data is for aircraft, not insects (but the principle is identical)).
https://app.box.com/s/tjyz7448peqh3za0r5tn7gaxh0xniyah
Maybe this helps you?
Regards,
Derek.

1,923

(2 replies, posted in General)

Hi David,
How's things?
I'm sure there's probably a way but one very simple option might be to select the 'bold text' appearance option in the tablegrid object properties (see the attached screenshot).  It doesn't change the light-grey background but makes the text a lot more prominent and so easier to spot.
It does mean that any cell that is clicked is highlighted all the time (and not just when you're doing a 'right-click' / find) but my users tend to prefer it like that anyway.
Hope this helps.
Derek.

Just occurred to me that a much easier and more efficient way to achieve the same effect is simply on 'mouse down' to get the script to move the image a small amount and then on 'mouse up' to move it back again - so no need for overlaying a second image - much cleaner!
Also, if on 'mouse down' you script it to move relative to it's starting position, if you subsequently redesign your form and place the image elsewhere, there is no code to change.
I'm a bit embarrassed I didn't think to do it that way ages ago sad
Derek

Hi Again Gonpublic2k,
Following on from my previous post, perhaps I should have explained that I often use images instead of buttons because they can be more intuitive.  However, they are 'static' even when clicked which is why I overlay the 2 identical images on top of each and then off-set one very slightly - when it's clicked, it then 'moves' slightly, as if it has been clicked like a button.
Attached is a simple example.
Perhaps this gives you a couple of more ideas.
Regards,
Derek.