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...............................
Adam
God... please help me become the person my dog thinks I am.