Skip to content

Commit

Permalink
Cargo doc auto deployment 2024-04-08 17:45:32.
Browse files Browse the repository at this point in the history
  • Loading branch information
rodrigocfd committed Apr 8, 2024
1 parent 8252cf6 commit 84aed01
Show file tree
Hide file tree
Showing 9 changed files with 145 additions and 22 deletions.
2 changes: 1 addition & 1 deletion search-index.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion search.desc/winsafe/winsafe-desc-2-.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion search.desc/winsafe/winsafe-desc-3-.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src-files.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions src/winsafe/gui/mod.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<a href="#68" id="68">68</a>
<a href="#69" id="69">69</a>
<a href="#70" id="70">70</a>
<a href="#71" id="71">71</a>
</pre></div><pre class="rust"><code><span class="doccomment">//! High-level GUI abstractions for user windows and native controls. They can
//! be created programmatically or by loading resources from a `.res` file.
//! These files can be created with a WYSIWYG
Expand All @@ -91,6 +92,7 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<span class="kw">mod </span>msg_error;
<span class="kw">mod </span>native_controls;
<span class="kw">mod </span>privs_gui;
<span class="kw">mod </span>proc;
<span class="kw">mod </span>raw_base;
<span class="kw">mod </span>raw_control;
<span class="kw">mod </span>raw_main;
Expand Down
74 changes: 73 additions & 1 deletion src/winsafe/gui/native_controls/list_view_items.rs.html
Original file line number Diff line number Diff line change
Expand Up @@ -296,13 +296,50 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
<a href="#294" id="294">294</a>
<a href="#295" id="295">295</a>
<a href="#296" id="296">296</a>
<a href="#297" id="297">297</a>
<a href="#298" id="298">298</a>
<a href="#299" id="299">299</a>
<a href="#300" id="300">300</a>
<a href="#301" id="301">301</a>
<a href="#302" id="302">302</a>
<a href="#303" id="303">303</a>
<a href="#304" id="304">304</a>
<a href="#305" id="305">305</a>
<a href="#306" id="306">306</a>
<a href="#307" id="307">307</a>
<a href="#308" id="308">308</a>
<a href="#309" id="309">309</a>
<a href="#310" id="310">310</a>
<a href="#311" id="311">311</a>
<a href="#312" id="312">312</a>
<a href="#313" id="313">313</a>
<a href="#314" id="314">314</a>
<a href="#315" id="315">315</a>
<a href="#316" id="316">316</a>
<a href="#317" id="317">317</a>
<a href="#318" id="318">318</a>
<a href="#319" id="319">319</a>
<a href="#320" id="320">320</a>
<a href="#321" id="321">321</a>
<a href="#322" id="322">322</a>
<a href="#323" id="323">323</a>
<a href="#324" id="324">324</a>
<a href="#325" id="325">325</a>
<a href="#326" id="326">326</a>
<a href="#327" id="327">327</a>
<a href="#328" id="328">328</a>
<a href="#329" id="329">329</a>
<a href="#330" id="330">330</a>
<a href="#331" id="331">331</a>
<a href="#332" id="332">332</a>
</pre></div><pre class="rust"><code><span class="kw">use </span>std::any::TypeId;
<span class="kw">use </span>std::cell::RefCell;
<span class="kw">use </span>std::cmp::Ordering;
<span class="kw">use </span>std::rc::Rc;

<span class="kw">use </span><span class="kw">crate</span>::co;
<span class="kw">use </span><span class="kw">crate</span>::decl::<span class="kw-2">*</span>;
<span class="kw">use </span><span class="kw">crate</span>::gui::{<span class="kw-2">*</span>, native_controls::iterators::<span class="kw-2">*</span>, spec::<span class="kw-2">*</span>};
<span class="kw">use </span><span class="kw">crate</span>::gui::{<span class="kw-2">*</span>, native_controls::iterators::<span class="kw-2">*</span>, proc::<span class="kw-2">*</span>, spec::<span class="kw-2">*</span>};
<span class="kw">use </span><span class="kw">crate</span>::msg::<span class="kw-2">*</span>;
<span class="kw">use </span><span class="kw">crate</span>::prelude::<span class="kw-2">*</span>;

Expand Down Expand Up @@ -591,5 +628,40 @@ <h2>Files</h2></div></nav><div class="sidebar-resizer"></div>
.SendMessage(lvm::SetItemCount { count, behavior })
}.unwrap();
}

<span class="doccomment">/// Sorts the items according to a callback by sending an
/// [`lvm::SortItemEx`](crate::msg::lvm::SortItemEx) message.
///
/// The callback receives the two items to be compared.
///
/// # Examples
///
/// Sorting by the text of the first column:
///
/// ```no_run
/// use winsafe::{self as w, prelude::*, gui};
///
/// let my_list: gui::ListView; // initialized somewhere
/// # let wnd = gui::WindowMain::new(gui::WindowMainOpts::default());
/// # let my_list = gui::ListView::&lt;()&gt;::new(&amp;wnd, gui::ListViewOpts::default());
///
/// my_list.items().sort(|itemA, itemB| -&gt; std::cmp::Ordering {
/// itemA.text(0).cmp( &amp;itemB.text(0) )
/// });
/// ```
</span><span class="kw">pub fn </span>sort&lt;F&gt;(<span class="kw-2">&amp;</span><span class="self">self</span>, func: F)
<span class="kw">where </span>F: FnMut(ListViewItem, ListViewItem) -&gt; Ordering,
{
<span class="kw">let </span><span class="kw-2">mut </span>func = func;
<span class="kw">let </span>data = (<span class="self">self</span>.owner, <span class="kw-2">&amp;mut </span>func);

<span class="kw">unsafe </span>{
<span class="self">self</span>.owner.hwnd()
.SendMessage(lvm::SortItemsEx {
param: <span class="kw-2">&amp;</span>data <span class="kw">as </span><span class="kw-2">*const </span><span class="kw">_ as _</span>,
callback: list_view_item_sort::&lt;F&gt;,
})
}.unwrap();
}
}
</code></pre></div></section></main></body></html>
Loading

0 comments on commit 84aed01

Please sign in to comment.