376

(11 replies, posted in General)

Hi EHW,


I had a look at it but couldn't spot the flaw you mention.


Very nice and creative approach, I must admit. It would work fine with fixed form width and grid columns. Top of that we can always add text wrapping on bookmarks tGrid.
In the process I'm learning new things.


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

377

(11 replies, posted in General)

Hi EHW,

I like the alternative you have kindly provided.
Great Stuff.... Thank you very much..... Truly appreciated...........


Hi JB,
It wasn't the case here but thanks for the info.


Dmitry,
Is there any way to link a tgrid record to an editable tGrid?
purpose is;
adding, editing, deleting and displaying details on editable tGrid of selected tGrid record.
Using two tGrids.

378

(11 replies, posted in General)

Hi EHW,


Thank you very much.............
Truly appreciated..................


It'd be a step forward if we could copy the app name from App name tGrid  to editable tGrid combo under App column. I tried the following that didn't work. Most likely for the reason you have stated about the  "inplace edit" tGrid.

procedure Form1_tgMainBookmarks_OnCellClick (Sender: TObject; ACol, ARow: Integer);
begin
Form1.tgMainBookmarks.Cells[3,Form1.tgMainBookmarks.SelectedRow] := Form1.tgMainAppName.Cells[1,Form1.tgMainAppName.SelectedRow];
end;

If the above worked, then we could hide or disable App column on editable tGrid. However, I'm not sure if it's possible to disable editable tGrid column or not.

379

(11 replies, posted in General)

I wanted to do a quick bookmark manager app for bookmarking script lines on MVD.
When script lines goes over 1000 lines finding procedures becomes bit of a hassle.

Using one non editable tGrid and one editable tGrid on same form. Couldn't make the connection. When an application selected on non editable table, I like to add bookmarks on editable table.


Please see the attached sample project:

380

(9 replies, posted in General)

It's not to hard to upgrade NextGrid5 to NextGrid6 for me...

That's a good news.


... but users will get incompatibilities if they use script to interact with grid.

Like in everything else in this life, we'd have to adopt the changes if we want to survive and improve. Those of us who has dependencies on v5 then they can always use MVD with v5.

381

(9 replies, posted in General)

Thanks for the info Dmitry.....


...Developer of the Grid not support it anymore.

I assume you mean NextGrid 5?
Developer released v6 as I'm sure you are aware of it.
Assuming MVD is still using v5; is upgrading to v6 too costly? If so how much?
I'm sure some loyal MVD user would chip in. Myself I would pay flat $200 for upgrading my v3 MVD to v4.
Beside, Next Grid 6 extra features may also encourage some other MVD users to upgrade.


Please forgive me if I'm talking beyond my boundaries.

382

(9 replies, posted in General)

DriveSoft wrote:

No.


Obviously that's not the answer I was hoping to hear : (


OK, let me expand my question.
Are you going to fix it? If yes, when it'd be fixed at the latest?


Is it a difficult bug to fix it? Isn't it possible to get some help from tGrid component developer?


Could you possibly fix it as quickly as you can please. Please do not harm my love for MVD.
I'm waiting for this bug to be fixed to upgrade my v3 license to v4.

383

(9 replies, posted in General)

AD1408 wrote:

Hi Dmitry,


Is there still no fix for the above tGrid scroll bug?

....


Any news?

384

(3 replies, posted in General)

Hi Dmitry,
Thank you very much..............
Looks like I wasn't able to think "Outside the box".


Hi Derek,
Thank you very much for alternatives..............
Especially for keyboard shortcut option. I learned something new.

385

(3 replies, posted in General)

I couldn't get my head around to make it work.


What I wanted do is a kind of slide panel made visible on button click and not visible on mouse leave of the panel. It fails on when mouse moved over a button within the panel (in this example) then panel becomes not visible. Panel should be visible until mouse leaves the panel or a button in the panel clicked.


I have done accordion style, which works but in this case I like the panel becomes invisible once mouse leaves the panel rather than clicking again show/hide toggle button.


The purpose of it is to save space on the form.


Please see the attached sample project:

386

(2 replies, posted in General)

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


Straight c/p didn't work. I realized dots were missing. When I added the dots where needed then it worked fine.
(frmSaleInv.edSIpaidValue.Text)


Once again thanks a lot for your kind help.

387

(2 replies, posted in General)

The following script works with combo style Dropdown but combo style Dropdown List doesn't. "Showrecord" part fails, doesn't display the saved combo item.

procedure frmSaleInv_OnShow (Sender: TObject; Action: string);
begin
frmSaleInv.cbSIpaid.Clear;
frmSaleInv.cbSIpaid.Items.Add('Fully Paid');
frmSaleInv.cbSIpaid.Items.Add('Partially Paid');
frmSaleInv.cbSIpaid.Items.Add('Unpaid');

If frmSaleInv.dbAction = 'ShowRecord' then
   Begin
   frmSaleInv.cbSIpaid.Text := frmSaleInv.edSIpaidValue.Text;
   End;
end;

procedure frmSaleInv_cbSIpaid_OnChange (Sender: TObject);
begin
frmSaleInv.edSIpaidValue.Text := frmSaleInv.cbSIpaid.Text;
end;

♦ How can I make the script above works fully for combo style Dropdown List?
♦ Alternatively, is it possible to make combo style Dropdown read only?

388

(2 replies, posted in General)

Hi Derek,


Thank you very much........................
Truly appreciated.................................

389

(2 replies, posted in General)

I couldn't get supplier names and address displayed on sale inv item form properly.


One product one supplier seems to be working OK but when multiple products associated to a supplier the it doesn't.
Please see form1 Sale Inv item 2. Try to add Product 0004, 0005 and 0006.


Product and SaleInvItem tables are linked to Supplier table.
Idea is to get supplier details displayed on frmSaleInvItem once a product is selected from cbSIitemProduct combobox.


Please see the attached sample project.

390

(9 replies, posted in General)

Hi Dmitry,


Is there still no fix for the above tGrid scroll bug?


I think it's quite an important bug that needs to be fixed.
Sometimes, mouse will and keyboard arrow keys don't work either.


For example, where tGrid height fits 10 record, on 11th record it should show the vertical scroll bar but it doesn't. Only way out is to add another record (12th record) to get vertical scroll bar.


I can work out for my own use but it's impossible to explain to end user as I cannot say there is a bug and try to explain workarounds.


Could you please fix this bug ASAP?

391

(28 replies, posted in General)

Hi EHW,


Thank you very much...............
Truly appreciated...................


Thanks to EHW and Derek, now we have feature rich CountDown timer.
It has been great learning exercise for me.


All credit goes to EHW and Derek....


Thank you for your kind help and guidance guys...................

392

(28 replies, posted in General)

Thank you very much Derek.............
That'll do nicely.


Now only remaining item is ProgressBar

393

(28 replies, posted in General)

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


Running count is a nice touch. Appreciated.
I also added running count below message box using labels.


Remaining items are:
1. Progress bar.
Tried to follow Dmitry's code but couldn't get it working.


3. Flashing text effect for finished caption text
Nothing fancy. Just a repeating two color changes with short intervals so that it gives flashing effect.


Latest version of the CountDown project I have is attached:

394

(28 replies, posted in General)

Thank you very much Derek.................
Truly appreciated.............


Thanks to Derek item 2 is done.


Now remaining items are:
1. Progress bar.
Tried to follow Dmitry's code but couldn't get it working.


3. Flashing text effect for finished caption text
Nothing fancy. Just a repeating two color changes with short intervals so that it gives flashing effect.

395

(28 replies, posted in General)

Hi Derek,


Thank you very much..............
I also added your line

form1.labelfinished.caption := sqlexecute('select message from messages order by random()'); 

under Form1_btnReset_OnClick


Only thing remains for item 2 is limiting message characters. It's fine using table header as info flag but as you know user will overlook and type longer messages. As you said "... but, you could do the job more thoroughly and trap for input greater than NN characters and display an error message."
Unfortunately, I don't know how to code trapping input.

396

(28 replies, posted in General)

Hi Derek,


Thank you very much....


Unless I'm missing something you worked on item 2.
That's not what I meant. Most likely my explanation was not clear.
I would like to display random message in random order, every time countdown finishes. In this respect we don't need a use column as messages displayed randomly.

Say we have 10 messages entered to tGrid
First countdown 1st message
Second countdown 2nd message
....
Tenth countdown 10th message

Eleventh countdown starts with 5th message (this time it starts somewhere middle)
uses 5 + messages upto available 10 messages then 5 minus up to and including message 1

21st countdown starts with i.e. 8th message then count up or down until available messages used

31st countdown starts with i.e. 4th message count up or down until available messages used

an so on....

In order to reduce predictability in certain degree.

397

(28 replies, posted in General)

Thank you very much for the explanation EHW. As always truly appreciated.....


I like to add couple more features to countdow timer for learning purposes.


1. Progress bar.
Tried to follow Dmitry's code but couldn't get it working.


2. Currently single message displayed when countdown finishes.
Could we get it display some hard coded or db table lookup style random messages. Different one per countdown? Such as:
form1.LabelFinished.caption := 'Eagle has landed';
//form1.LabelFinished.caption := 'Godot has arrived';
//form1.LabelFinished.caption := 'Finished spinning wheel';
//form1.LabelFinished.caption := 'Mercury is conquered';
If done via db table lookup style using form settings with new tab sheet, where user can enter their own finished messages; may present some extra work in respect of limiting message characters counts so that they fit in message panel on form1


3. Flashing text effect for finished caption text
Nothing fancy. Just a repeating two color changes with short intervals so that it gives flashing effect.


Latest version of the CountDown project I have is attached:

398

(28 replies, posted in General)

Hi EHW.


GREAT Stuff !!!
Thank you very much.............................
Truly appreciated...........................


... I wasn't sure what the purpose is for the countUP table. I did not do anything with that....

Knowledge shortage at my part. I was thinking those text fields as combo items value holder but now after your pointing out there is no need to save them in this situation.


Extra thank you for trimming the script in respect of combo items and color dialog. More learning references for me.


I couldn't understand how you get/define values (numbers and "") in line below? If you could explain id'd be appreciated.

If SqlExecute('Select Count(id) From Settings') = 0 then SqlExecute('Insert Into Settings Values (1,65280,0,65280,65280,0,0,0,0,0,16776960,16776960,16776960,"")');

I wanted replace system error/info dialog messages below wit a user friendly versions on settings form:
Clicking on Play button when play sound checkbox is checked and sound file edit field has no sound file
"Cannot determine the device type from the given filename extention."
and stop button
"No MCI device open."


I tried Dmitry's code for foreign key retraints but didn't work. I suspect function is incorrect:

function OnSQLException(Sender: TObject; Msg: string; SQL: string): boolean;
begin
if Sender = frmSettings.btnPlay then
   begin
   if Pos('Cannot determine the device type from the given filename extention.', Msg)=1 then
      begin
      result := True;
      MessageBox('No sound file was selected. Please select a .mp3 or .wav sound file first by clicking on Sound File button.', 'Error', MB_OK+MB_ICONWARNING);
      end;
   end;
end;

I ended up disabling/enabling play and stop buttons, which may not be a proper solution:

procedure frmSettings_cBoxPlaySound_OnClick (Sender: TObject);
If (frmSettings.cBoxPlaySound.Checked = True) and (frmSettings.edSoundFile.Text <>'') then
   begin
   frmSettings.btnPlay.Enabled := True;
   frmSettings.btnStop.Enabled := True;
   end else;

If (frmSettings.cBoxPlaySound.Checked = True) and (frmSettings.edSoundFile.Text = '') then
   begin
   frmSettings.btnPlay.Enabled := False;
   frmSettings.btnStop.Enabled := False;
   end;
end;

procedure frmSettings_edSoundFile_OnChange (Sender: TObject);
begin
If (frmSettings.cBoxPlaySound.Checked = True) and (frmSettings.edSoundFile.Text <>'') then
   begin
   frmSettings.btnPlay.Enabled := True;
   frmSettings.btnStop.Enabled := True;
   end else;

If (frmSettings.cBoxPlaySound.Checked = True) and (frmSettings.edSoundFile.Text = '') then
   begin
   frmSettings.btnPlay.Enabled := False;
   frmSettings.btnStop.Enabled := False;
   end;
end;

Once again thank you so much for your kind help...............................

399

(28 replies, posted in General)

I have tried to apply EHW's settings code (changing display colors) but I get couple of errors.
"" not valid integer error under frmSettings_OnShow event starting at line 301, commented out.
♦ I couldn't understand the code between
   begin
   ....
   end.
   fully. It crashes the app on compile. Commented out.


I'm hoping that EHW is around and have some free time finish settings fully (Sound and Display tabs settings items)...
Or any other kind person who can do it...
It has been great learning exercise, at least for me.


Please see the attached latest CountDown project:

400

(28 replies, posted in General)

Hi Derek,


Thank you very much..............
Truly appreciated ......................


Good thinking on preventing the clock going negative. Also added negative prevention to Reset button, so that it resets to 01 instead of 00


I did try ItemIndex also but on the wrong place, before combo items.add lines. I'm searching ways to inject another cell into my brain as single cell fails me often.


Next, I'll try to apply EHW's code from StopWatch for settings screen.