1

(2 replies, posted in General)

Hi Sparrow,


Thank you very much for the alternative.


Here is a quick example of adding, editing and deleting on same form. It works fine with TG only. However, getting it work with treeview and TG properly, that I couldn't achieve.
-----------
edit: Enabling add btn in some situations were missing. Example file is updated.

2

(7 replies, posted in General)

derek wrote:

Hi Adam,
If you use Form2 with borderstyle = none and position Form2 appropriately over Form1, I'm not sure where there is much complexity.  I appreciate that it's not strictly using Form1 for adding/editing nodes on the tree but the end result is, as far as I can tell, the same.
Attached is an amendment to the earlier example with everything but the basic functionality stripped out.
Derek.


Hi Derek,
Thank you very much........
It comes close enough what I was trying to do.
I guess it's complicated to do everything on form1.

3

(7 replies, posted in General)

Hi Sparrow, Derek,
Looks like more complicated than I thought; what I was trying to achieve. I give up the idea of doing everything on same form when treeview is
involved.
Thank you very much for your help guys........

4

(7 replies, posted in General)

sparrow wrote:

Hi Adam,


What logic are you trying to implement with treeview, table and edit field? How should they interact? Please describe.


Hi Sparrow,


I'm trying to do same thing if we were adding records via second form. Only difference is I like to achieve same thing on same form.
For example, If I select tree node '1111' on form1 tree and add a record, I like it to get listed in tree node '1111' on form1 not in root  (None) of the tree.
Basically, a record added to a selected node on same form, is not showing within that selected node.


There are more fields on actual project. On sample project, I only used one field and not done enabling / disabling buttons and fields which I'll do later.

5

(7 replies, posted in General)

Hi Guys,
I'm trying to do Add/Edit/Delete operations on same form (form1) using treeview and tg.
Issue I couldn't solve all records getting saved in treeview root instead of  in selected node.
Please see the sample project attached below:

6

(22 replies, posted in General)

Hi Sparrow,


Thank you very much for the info.

7

(22 replies, posted in General)

Thank you very much........


I tried to browse db using SQL Lite Studio but couldn't locate the value you have added in the record_count column. I'm fairly ignorant on using SQL Lite Studio.


I guess Issue is caused by old project I was trying to use.

8

(22 replies, posted in General)

sparrow wrote:

HI Adam
....

For changing the PLACE WITHIN ITS NODE I gave the link above.

...

Thanks... It would have been great if it could be done both. However, what you guys have done truly appreciated...


I got the script you refer. I originally asked to Dmitry for the script - moving nodes on same level.
I get it work sometimes OK sometimes not.


For instance, the attached sample project I couldn't get it working. I checked syntax etc., but couldn't find the cause of failure.

9

(22 replies, posted in General)

sparrow wrote:

Hi all,


With Derek's permission, here are two versions of the example of dragging tree nodes with the mouse in one archive.
Derek's corrected version and my version. Both versions do the same job. wink Hopefully without any major errors this time.


Hi Sparrow,
If I'm not doing something wrong, cannot move node up and down on same level. Moved node goes as a child.

10

(22 replies, posted in General)

Hi Guys,
Thank you very much for tree nodes drag n drop....
Santa arrived to MVD bit late but still truly appreciated the Gift.....

11

(15 replies, posted in General)

sparrow wrote:

In all cases, the Statement clause must be a contained in a begin/end block if it is longer than one statement in length.


procedure Form1_TableGrid1_OnChange (Sender: TObject);
var i,c: integer;
begin
  c := form1.TableGrid1.rowCount - 1;
  for i := 0 to c do
  begin
    if form1.TableGrid1.cells[1,i] = 'Up' then
    begin
     form1.TableGrid1.cell[1,i].Color := $0080FF80;
     Form1.TableGrid1.Cell[1,i].textColor := $0080FF80;
    end; 

    if form1.TableGrid1.cells[1,i] = 'Dn' then
    begin
      form1.TableGrid1.cell[1,i].Color := $003E3EFF;
      Form1.TableGrid1.Cell[1,i].textColor := $003E3EFF;
    end; 

    if form1.TableGrid1.cells[1,i] = 'Rn' then
    begin
     form1.TableGrid1.cell[1,i].Color := $00B4B4B4;
     Form1.TableGrid1.Cell[1,i].textColor := $00B4B4B4;
    end;
  end;
end;

Thank you very much...........
Unfortunately, my brain with limited cells could not understand your previous advice fully.

12

(15 replies, posted in General)

sparrow wrote:

If works as follows :

(if Condition then Statement)

If the condition is true, then the first statement is executed. If false, then this statement is bypassed. If there is an else statement, it is executed instead.

In all cases, the Statement clause must be a contained in a begin/end block if it is longer than one statement in length.


Hi Sparrow,
Thank you very much for your kind help......


I did as follows and seem it works:

procedure Form1_TableGrid1_OnChange (Sender: string);
begin
OnChange1;
OnChange1b;
end;
//
//
procedure OnChange1;
var i,c: integer;
begin
c := form1.TableGrid1.rowCount - 1;
for i := 0 to c do
begin
if form1.TableGrid1.cells[1,i] = 'Up' then
   form1.TableGrid1.cell[1,i].Color := $0080FF80;

if form1.TableGrid1.cells[1,i] = 'Dn' then
   form1.TableGrid1.cell[1,i].Color := $003E3EFF;

if form1.TableGrid1.cells[1,i] = 'Rn' then
   form1.TableGrid1.cell[1,i].Color := $00B4B4B4;
end;
end;
//
//
procedure OnChange1b;
var i,c: integer;
begin
c := form1.TableGrid1.rowCount - 1;
for i := 0 to c do
begin
if form1.TableGrid1.cells[1,i] = 'Up' then
   Form1.TableGrid1.Cell[1,i].textColor := $0080FF80;

if form1.TableGrid1.cells[1,i] = 'Dn' then
   Form1.TableGrid1.Cell[1,i].textColor := $003E3EFF;

if form1.TableGrid1.cells[1,i] = 'Rn' then
   Form1.TableGrid1.Cell[1,i].textColor := $00B4B4B4;
end;
end;

13

(15 replies, posted in General)

Hi Guys,


Playing with tg cell and text colors for another use scenario. However, couldn't get cell text color working?


Please see the sample project below:

14

(15 replies, posted in General)

Hi Derek and Sparrow,
Thank you very much guys for your kind help.............
Truly appreciated.................

15

(15 replies, posted in General)

Hi Derek,


I've tried to add more colored columns but couldn't get it working.
Additionally, as I only need colors, I tried to get rid of text displayed in tg cells and textboxes but failed here too.


Please see the sample project below:

16

(10 replies, posted in General)

Hi Derek,
I knew you could come up with something useful.
Great stuff.
Thank you very much......................

17

(10 replies, posted in General)

Happy New Year to all.......


Hi Derek,
Did you manage to highlight calendar dates that contain entry by way of coloring the font and / or background of the font beside bolding the font?

18

(15 replies, posted in General)

derek wrote:

Hi Adam,
Can you try again - I've just reloaded it.
Derek.

Hi Derek,
All good now.
Thank you very much.

19

(15 replies, posted in General)

derek wrote:

Hi Adam,
Try something like this (and don't blame me if it looks like some cheesy 1970s disco with all the colours big_smile).
I'd also recommend setting 'goselectfullrow' to false on the tablegrid so you can see the colours immediately after saving (otherwise they get masked by the row highlighting).
Derek.

Hi Derek,
Thank you very much...
My Win 11 doesn't let me download the file you've posted, saying there is virus.

20

(15 replies, posted in General)

Hi Guys,


I wanted fill the some cells on a tablegrid with color but couldn't do it. It's not assigning static cell bg color.
Each record can have different colors (selected by the user and saved).
For instance,
Select a color from windows color dialog, display it on the panels on a form (one color per panel) then save the
to display on them tablegrid cells.


Please see the sample project attached.

https://i.postimg.cc/vBdTR8fL/image-2024-12-10-154312660.png

21

(18 replies, posted in General)

Hi Sparrow,


Great stuff... Thank you very much.....


The following items are just wishful suggestion. You may consider them if and when you can do:
- Adding your drag n drop
- Auto naming of the pasted and dragged n dropped image file (if implemented) beside manual entry every time. Starting name defined by the user ie. A0001 then app carries on by incrementing the number by one until user changes the name, then it continues with changed name. Auto numbering would .starts counting from user defined number. ie. if user named the item B00125 then app continues with B00126, B00127 and so on.

22

(18 replies, posted in General)

Hi Derek,


Thank you very much for the info you have provided. Very kind of you.
It's shame that MVD cannot save pasted .bmp as a jpg - as I understand. I have nothing against .bmp other than it's larger file size.

23

(18 replies, posted in General)

Hi Derek,


You have understood my question fully and provided the solution I was looking for.


Thank you very much..........


Can we also paste .png and .jpg beside .bmp?
I noticed, images saved in root folder of the app in addition to saving as linked 'images' folder.

24

(18 replies, posted in General)

Hi Sparrow,
Hi JB,


While dragging is great and does most of the image copying, there are some image sources those are not draggable. Those type of images/graphics etc., Currently, I copy using image capture utility, such as Lightshot then I paste into accommodating apps or save to a local disk then open from there for use in MVD.
I thought it also would be useful to paste the copied image to MVD dbimage if possible.

25

(2 replies, posted in General)

sparrow wrote:

comment out the line

form1.treeview1.columns[1].visible := false;

In the tree table, look at the ID number in the second column for the second level.


Hi Sparrow,
Thank you very much....
I'm trying to sort it using DB Browser for SQL light.