<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[My Visual Database — Раскрашивание строки по чекбоксу]]></title>
		<link>https://myvisualdatabase.com/forum/viewtopic.php?id=8672</link>
		<atom:link href="https://myvisualdatabase.com/forum/extern.php?action=feed&amp;tid=8672&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in Раскрашивание строки по чекбоксу.]]></description>
		<lastBuildDate>Sat, 09 Sep 2023 13:46:03 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: Раскрашивание строки по чекбоксу]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=48764#p48764</link>
			<description><![CDATA[<div class="quotebox"><cite>pavlenko.vladimir.v wrote:</cite><blockquote><div class="quotebox"><cite>Vickus wrote:</cite><blockquote><p>Добрый день!<br />Помогите, пожалуйста, с примером. Необходимо при клике на чекбокс в таблице, чтобы строка окрашивалась в любой цвет.<br />Спасибо!</p></blockquote></div><div class="codebox"><pre><code>procedure Form1_TableGrid1_OnEditAccept (Sender: TObject; ACol, ARow: Integer; Value: String; var Accept: Boolean);
var
i,CC: integer;
begin
  if (Form1.TableGrid1.Cell[ACol,ARow].AsBoolean = False) then
  begin
     CC := randomColor;
     for i:=0 to Form1.TableGrid1.Columns.Count-1 do
         Form1.TableGrid1.Cell[i,ARow].Color := CC;
  end else
    for i:=0 to Form1.TableGrid1.Columns.Count-1 do
         Form1.TableGrid1.Cell[i,ARow].Color := clWhite;
end;

function randomColor: integer;
var
RR:integer;
begin
  Randomize;
  RR := Random(7);
  CASE RR OF
  1: Result := clFuchsia;
  2: Result := clGray;
  3: Result := clGreen;
  4: Result := clNavy;
  5: Result := clTeal;
  6: Result := clAqua;
  7: Result := clHighlight;
  end;
end;

procedure Form1_OnShow (Sender: TObject; Action: string);
begin
  if (SQLExecute(&#039;SELECT COUNT(id) FROM template&#039;) = &#039;0&#039;) then
     SQLExecute(&#039;INSERT INTO template(name)VALUES(&quot;Первое поле&quot;),(&quot;Второе поле&quot;),(&quot;Третье поле&quot;),(&quot;Четвертое поле&quot;)&#039;);  
end;</code></pre></div></blockquote></div><br /><p>СПАСИБО!!!</p>]]></description>
			<author><![CDATA[null@example.com (Vickus)]]></author>
			<pubDate>Sat, 09 Sep 2023 13:46:03 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=48764#p48764</guid>
		</item>
		<item>
			<title><![CDATA[Re: Раскрашивание строки по чекбоксу]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=48762#p48762</link>
			<description><![CDATA[<div class="quotebox"><cite>Vickus wrote:</cite><blockquote><p>Добрый день!<br />Помогите, пожалуйста, с примером. Необходимо при клике на чекбокс в таблице, чтобы строка окрашивалась в любой цвет.<br />Спасибо!</p></blockquote></div><div class="codebox"><pre><code>procedure Form1_TableGrid1_OnEditAccept (Sender: TObject; ACol, ARow: Integer; Value: String; var Accept: Boolean);
var
i,CC: integer;
begin
  if (Form1.TableGrid1.Cell[ACol,ARow].AsBoolean = False) then
  begin
     CC := randomColor;
     for i:=0 to Form1.TableGrid1.Columns.Count-1 do
         Form1.TableGrid1.Cell[i,ARow].Color := CC;
  end else
    for i:=0 to Form1.TableGrid1.Columns.Count-1 do
         Form1.TableGrid1.Cell[i,ARow].Color := clWhite;
end;

function randomColor: integer;
var
RR:integer;
begin
  Randomize;
  RR := Random(7);
  CASE RR OF
  1: Result := clFuchsia;
  2: Result := clGray;
  3: Result := clGreen;
  4: Result := clNavy;
  5: Result := clTeal;
  6: Result := clAqua;
  7: Result := clHighlight;
  end;
end;

procedure Form1_OnShow (Sender: TObject; Action: string);
begin
  if (SQLExecute(&#039;SELECT COUNT(id) FROM template&#039;) = &#039;0&#039;) then
     SQLExecute(&#039;INSERT INTO template(name)VALUES(&quot;Первое поле&quot;),(&quot;Второе поле&quot;),(&quot;Третье поле&quot;),(&quot;Четвертое поле&quot;)&#039;);  
end;</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (pavlenko.vladimir.v)]]></author>
			<pubDate>Sat, 09 Sep 2023 10:14:14 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=48762#p48762</guid>
		</item>
		<item>
			<title><![CDATA[Раскрашивание строки по чекбоксу]]></title>
			<link>https://myvisualdatabase.com/forum/viewtopic.php?pid=48758#p48758</link>
			<description><![CDATA[<p>Добрый день!<br />Помогите, пожалуйста, с примером. Необходимо при клике на чекбокс в таблице, чтобы строка окрашивалась в любой цвет.<br />Спасибо!</p>]]></description>
			<author><![CDATA[null@example.com (Vickus)]]></author>
			<pubDate>Sat, 09 Sep 2023 05:27:12 +0000</pubDate>
			<guid>https://myvisualdatabase.com/forum/viewtopic.php?pid=48758#p48758</guid>
		</item>
	</channel>
</rss>
