<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: SingleSelListBox empty area click in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/SingleSelListBox-empty-area-click/m-p/661067#M10313</link>
    <description>&lt;P&gt;Thnaks, I guess it may be not a bug, but a native listbox control feature.&lt;BR /&gt;&lt;BR /&gt;Usually it is not big issue. But in one of my table with ontab controls&amp;nbsp;&lt;SPAN&gt;I would &lt;/SPAN&gt;&lt;SPAN class="aNeGP0gI0B9AV8JaHPyH" data-src-align="0:8"&gt;like&lt;/SPAN&gt; &lt;SPAN class="aNeGP0gI0B9AV8JaHPyH" data-src-align="9:2"&gt;to clear selection (and remove ontab editing) for convenience.&lt;BR /&gt;Funny, the is no&amp;nbsp;&lt;SPAN&gt;ListBoxSelectionChanged event, if do a click on already selected row, as a trick to remove selection.&lt;BR /&gt;So I found only one trick&amp;nbsp;not very obvious to the user, but worked.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;bool TableStageDelivery::ListBoxSelectionChangeRequested(const DG::ListBoxMouseDownEvent&amp;amp; ev)
{
	if (ev.GetSource() == &amp;amp;mi_list)
	{
		short item = ev.GetListItem();
		if (item == mi_list.GetSelectedItem())
		{
			mi_list.DeselectItem(item);
			OnSelectionChanged(true);
			return true;
		}
	}

	return false;
}&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN class="aNeGP0gI0B9AV8JaHPyH" data-src-align="9:2"&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 29 Apr 2025 16:31:03 GMT</pubDate>
    <dc:creator>Oleg</dc:creator>
    <dc:date>2025-04-29T16:31:03Z</dc:date>
    <item>
      <title>SingleSelListBox empty area click</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SingleSelListBox-empty-area-click/m-p/660362#M10294</link>
      <description>&lt;P&gt;From the Dialog Managet help:&lt;/P&gt;
&lt;DIV id="content" class="inset"&gt;
&lt;P&gt;&lt;EM&gt;"A mouse click on the empty client area of a list box (where there is no list item) removes all the previous selections."&lt;BR /&gt;&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is true for a MultiSelListBox. But SingleSelListBox does not remove a selection.&lt;BR /&gt;I did not found any event to do this by code.&amp;nbsp;&lt;BR /&gt;( ListBoxClicked,&amp;nbsp;ListBoxMouseDown,&amp;nbsp;ListBoxSelectionChangeRequested,&amp;nbsp;ItemMouseDown,&amp;nbsp;ItemClicked dont filred )&lt;BR /&gt;&lt;BR /&gt;Is there any trick ?&lt;BR /&gt;&lt;BR /&gt;PS: Tried to force MultiSelListBox no more one selectection with no sucsess.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;/DIV&gt;</description>
      <pubDate>Wed, 23 Apr 2025 14:35:49 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SingleSelListBox-empty-area-click/m-p/660362#M10294</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2025-04-23T14:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: SingleSelListBox empty area click</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SingleSelListBox-empty-area-click/m-p/661031#M10309</link>
      <description>&lt;P&gt;I've got a number of single selection lists and they seem to be acting correctly, i.e. clicking in a blank area deselects everything. Although I think we have tab controls mapped to list columns - possibly that makes it behave differently?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I also override DG&lt;SPAN&gt;::&lt;/SPAN&gt;ListBoxObserver methods like ListBoxSelectionChanged (which&amp;nbsp;fires when the blank are is clicked and checking the selected row returns 0). At this point the tab controls are refreshed and the list is redrawn. Possibly that's a factor?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Apr 2025 13:08:00 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SingleSelListBox-empty-area-click/m-p/661031#M10309</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2025-04-29T13:08:00Z</dc:date>
    </item>
    <item>
      <title>Re: SingleSelListBox empty area click</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SingleSelListBox-empty-area-click/m-p/661058#M10311</link>
      <description>&lt;P&gt;Hello Ralph, thank you for reply.&lt;BR /&gt;&lt;BR /&gt;Most of my tables have columns (tabfields) and often have ontab edit controls.&lt;BR /&gt;But click below rows into empty space dont clear a selection and ListBoxSelectionChanged did not fired.&lt;BR /&gt;Windows only. May be there is difference Mac-Win platforms ?&lt;BR /&gt;&lt;BR /&gt;PS: And currently on this workplace I tried max AC26 API.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Apr 2025 15:56:02 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SingleSelListBox-empty-area-click/m-p/661058#M10311</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2025-04-29T15:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: SingleSelListBox empty area click</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SingleSelListBox-empty-area-click/m-p/661064#M10312</link>
      <description>&lt;P&gt;Oh yeah, you're right - it works on macOS but not Windows. Smells like a bug…&lt;/P&gt;</description>
      <pubDate>Tue, 29 Apr 2025 16:09:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SingleSelListBox-empty-area-click/m-p/661064#M10312</guid>
      <dc:creator>Ralph Wessel</dc:creator>
      <dc:date>2025-04-29T16:09:03Z</dc:date>
    </item>
    <item>
      <title>Re: SingleSelListBox empty area click</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/SingleSelListBox-empty-area-click/m-p/661067#M10313</link>
      <description>&lt;P&gt;Thnaks, I guess it may be not a bug, but a native listbox control feature.&lt;BR /&gt;&lt;BR /&gt;Usually it is not big issue. But in one of my table with ontab controls&amp;nbsp;&lt;SPAN&gt;I would &lt;/SPAN&gt;&lt;SPAN class="aNeGP0gI0B9AV8JaHPyH" data-src-align="0:8"&gt;like&lt;/SPAN&gt; &lt;SPAN class="aNeGP0gI0B9AV8JaHPyH" data-src-align="9:2"&gt;to clear selection (and remove ontab editing) for convenience.&lt;BR /&gt;Funny, the is no&amp;nbsp;&lt;SPAN&gt;ListBoxSelectionChanged event, if do a click on already selected row, as a trick to remove selection.&lt;BR /&gt;So I found only one trick&amp;nbsp;not very obvious to the user, but worked.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;bool TableStageDelivery::ListBoxSelectionChangeRequested(const DG::ListBoxMouseDownEvent&amp;amp; ev)
{
	if (ev.GetSource() == &amp;amp;mi_list)
	{
		short item = ev.GetListItem();
		if (item == mi_list.GetSelectedItem())
		{
			mi_list.DeselectItem(item);
			OnSelectionChanged(true);
			return true;
		}
	}

	return false;
}&lt;/LI-CODE&gt;
&lt;P&gt;&lt;SPAN class="aNeGP0gI0B9AV8JaHPyH" data-src-align="9:2"&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Apr 2025 16:31:03 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/SingleSelListBox-empty-area-click/m-p/661067#M10313</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2025-04-29T16:31:03Z</dc:date>
    </item>
  </channel>
</rss>

