1

(9 replies, posted in General)

sparrow wrote:

- When selecting a record in the Tree that has child records, all events for the parent and all child records will be displayed in the calendar.
- When switching months, the information in the TableGrid for the selected month is updated.
- Calling a form for quickly changing the month and year when clicking on the month year header of the calendar.
- Only the days of the open month are painted.
- Some bugs have been fixed, new ones have been added, possibly.


Thank you very much....
I'll be checking it up and will report bugs etc. if any found.
I hope others will check and contribute to this excellent work too.

2

(9 replies, posted in General)

Hi Sparrow,


Yes, you have. That's what I was looking for.
GREAT stuff.
Thank you very much....................

3

(9 replies, posted in General)

sparrow wrote:

Hi Adam


I think you are going in the wrong direction. There is no need to create a new calendar element for each tree branch.
You can create an additional field in your table that links to the ID field of the tree. This will allow you to uniquely identify each event in the table with a tree branch.


I'm sure you know better ways to include treeview.
If and when you could get around, a working sample project would be great as I couldn't do it.

4

(9 replies, posted in General)

sparrow wrote:

Could you describe it in more detail or show how you imagine it?


Please see the attached image. Tried to explain what I meant in general. I hope it's clear enough, if not please let me know.

5

(9 replies, posted in General)

Hi Sparrow,


Is it possible to add treeview to your calendar, so that we can have a separate calendar for each tree node?
If possible, could you provide a sample project please?
That's of course if you have the time to do so...

Hi Sparrow,


Thank you very much for the advice....  and thank you for your time.
Truly appreciated....

Trying to make use of 'USES' function as I start to like it.
I tried to implement multiple instances of 'Form1_OnShow' event as:

procedure Form1_OnShow (Sender: string; Action: string);
begin
Frm1onShow1;  // Calendar
Frm1onShow2;  // General + RTF Font
Frm1onShow3;  // password
Frm1onShow4; // Menu

with the following .pas files:
'calend.pas',  // Calendar code
'passw.pas',  // Password code
'menu.pas';  // Menu code


However, couldn't get it working. It's coming up with script error saying 'BEGIN expected at ...'
Please see the attached app.

8

(2 replies, posted in General)

Hi Sparrow,


Thank you very much for a quick advice....
Truly appreciated....

9

(2 replies, posted in General)

Hi All,


I was trying to utilize Sparrow's "Custom Calendar" app. I'm getting 'ambiguous column name' error which I couldn't solve.
Please see the file below:

10

(4 replies, posted in General)

sparrow wrote:

Unfortunately, it is not clear from your words what is happening, and I can't guess. I am not a medium.
From the script fragment, I can only ask why you initially work with the "Items" table (select rtfname from Items ...) and
at the end of your fragment suddenly "test" (select rtfname from test ...)?


"Test' db name is mistake on my part.  It's 'Items' through out. I thought there may be something done with script but it's not clear on what I can provide you say. I understand and appreciate your attention. Thank you very much.

11

(4 replies, posted in General)

Hi Sparrow,


Thank you very much for your reply.


I think the issue may be with the linking script.
I took out linking script and changed to save into DB on Win7 which works fine on Win7. Same app (no linking RTF saved into DB) run on Win11 and displays RTF fine.

12

(4 replies, posted in General)

Hi All,


I've been using script below for linking RTF rather than saving into database, kindly provided by Derek:

procedure BrowseItems;
begin
form1.richedit1.clear;
form1.richedit1.deselect;
form1.richedit1.LoadRTF(sqlexecute('select rtfname from Items where id ='+form1.tablegrid1.sqlvalue));
end;

procedure Form1_Button3_OnClick (Sender: TObject; var Cancel: boolean); // Delete
begin
deletefile(extractfilepath(application.exename) + sqlexecute('select rtfname from Items where id =' +form1.tablegrid1.sqlvalue));
form1.richedit1.clear;
form1.richedit1.deselect;
end;

procedure form2_OnShow (Sender: TObject; Action: string);
begin
if action = 'ShowRecord' then form2.RichEdit1.LoadRTF(sqlexecute('select rtfname from Items where id ='+form1.tablegrid1.sqlvalue));
end;


procedure form2_Button1_OnClick (Sender: TObject; var Cancel: boolean);  //Save                                           
begin
if form2.RichEdit1.text <> '' then
   begin
   form2.edit2.text := 'rtfSTORE\' + form2.editcounter1.text + ' Main .rtf';
//or
   form2.edit2.text := extractfiledir(application.exename) + '\rtfSTORE\' + form2.editcounter1.text + ' Main .rtf';
   form2.richedit1.savertf(form2.edit2.text);
   end;
end;

procedure form2_OnClose (Sender: TObject; Action: string);
begin
form1.RichEdit1.LoadRTF(sqlexecute('select rtfname from test where id ='+form1.tablegrid1.sqlvalue));
end;

It's all fine on Win7 machine. All added and saved RTF content as a linked file using the above script on Win7 machine is not displayed on Win11 machine (RTF content only). However, with the same script adding and saving RTF content on Win11 has no problem getting displayed.


What I mean by not displayed on Win11 machine is that; RTF content added and saved on Win7 machine as Linked RTF.


Is there any solution available for this issue?

13

(11 replies, posted in General)

sparrow wrote:

The error occurs when trying to edit a record in the Tree and indicates that you are trying to write a change to the calculated field "Names-cf1".
Create a separate small form for editing the text of a record in the tree with a link to the table "OrgStructure". Create a button with the function "Show record" and call the form for editing the record.


Thanks a lot Sparrow....
I wish there was a way to add a calc field "Names-cf1" without interfering tree right click add / edit / delete operations...
In any case, I'm grateful  for your kind help...

14

(11 replies, posted in General)

Hi Sparrow,


I get the following error which I couldn't solve.
Please see the attached image:

15

(11 replies, posted in General)

Hi Sparrow,
Great stuff....
Thank you very much...........


Hi Jean,
Guy with skills is Sparrow. Perhaps he may be able to help you too.

16

(11 replies, posted in General)

sparrow wrote:

Hi,


Can you describe what exactly you want to do and what you want to achieve?

Hi Sparrow,
Currently, child tree nodes counted and relevant number displayed next to the node. This is all good.
What I like to add is the count display of tablegrid items. For instance, Director - Business Logistics node contains 3 tablegrid record then number 3 displayed for Business Logistics node in next column on treview.
Please see the attached illustration for additional explanation.

17

(11 replies, posted in General)

Hi Guys,


Attached test file contains Sparrows optimized tree nods and child nods count.
Can we add to it Tablegrid items count for the relevant tree nod too?
It may be displayed on a separate tree column.

18

(2 replies, posted in General)

Hi Sparrow,
Thank you very much........
Truly appreciated........

19

(2 replies, posted in General)

Hi all,


I have tried to break the following long line of script into two line  but failed. Any help please?

Form1.edRunBal.Value := ((Form1.TableGrid1.Columns[4].Footer.FormulaValue)+(Form1.TableGrid1.Columns[7].Footer.FormulaValue))-((Form1.TableGrid1.Columns[6].Footer.FormulaValue)+(Form1.TableGrid1.Columns[8].Footer.FormulaValue));

20

(3 replies, posted in General)

Hi Jean,
Thanks for the reply.
Up n Down buttons are actually for moving nodes up and down, not for sorting... in any case issue is not them.
When using separate form for adding/editing I know tree and tg connection but when I tried to do it on same form, it didn't work.


... and still I couldn't get it working properly.

21

(3 replies, posted in General)

Hi All,


Sometimes ago, with the help of Derek and EHW put together an app. where I could add/edit/delete on the same form.
I tried to add Treeview to it but couldn't get the connection between Treeview and Tablegrid... Couldn't get it work?


Here is the sample project:


ps/. I marked as unresolved, just in case somebody comes up with a solution.

22

(9 replies, posted in General)

Hi Derek,
Hi Sparrow,


Thanks a lot guys.........
Nice lil trick Sparrow... I'm sure it would benefit many MVD users here.

23

(9 replies, posted in General)

With the combo bg and text coloring script I get selection color highlight of combo text - see image below. Is there a way to stop the highlight.


https://thumbs2.imgbox.com/4b/69/mInZ9y8P_t.jpg

24

(9 replies, posted in General)

Thanks a lot Derek.....
Now, all good and working.

25

(9 replies, posted in General)

Hi again Derek,
It's all fine working fine until I use double digit numbers.


This works fine:

if (form1.combobox1.text in ['8'..'9']) then form1.combobox1.Color := clred else form1.combobox1.color := clwhite;
if (form1.combobox1.text in ['8'..'9']) then form1.combobox1.Font.Color := clyellow else form1.combobox1.font.color := clblack;

But this doesn't:

if (form1.combobox1.text in ['9'..'10']) then form1.combobox1.Color := clred else form1.combobox1.color := clwhite;
if (form1.combobox1.text in ['9'..'10']) then form1.combobox1.Font.Color := clyellow else form1.combobox1.font.color := clblack;

Here is the way I'm doing it: