<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Approximatrix Forums — usage of getfillsettings SF2.41]]></title>
		<link>http://forums.approximatrix.com/viewtopic.php?id=721</link>
		<atom:link href="http://forums.approximatrix.com/extern.php?action=feed&amp;tid=721&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[The most recent posts in usage of getfillsettings SF2.41.]]></description>
		<lastBuildDate>Tue, 17 Sep 2019 00:06:52 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: usage of getfillsettings SF2.41]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=3330#p3330</link>
			<description><![CDATA[<p>Not a bad idea.&nbsp; I&#039;ll look into adding it.</p>]]></description>
			<author><![CDATA[null@example.com (jeff)]]></author>
			<pubDate>Tue, 17 Sep 2019 00:06:52 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=3330#p3330</guid>
		</item>
		<item>
			<title><![CDATA[Re: usage of getfillsettings SF2.41]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=3329#p3329</link>
			<description><![CDATA[<p>After some trials and error i managed to guess the type structure : <br /></p><div class="codebox"><pre><code>call setfillstyle(pb%oldfill%pattern, pb%oldfill%color )</code></pre></div><p>can you please add a setfillsettings() please (in both SF2 and 3) if possible ?</p><p>the full code : </p><div class="codebox"><pre><code>module m_progressbar
    use appgraphics
    implicit none
    
    ! it&#039;s just cleaner that way
    type progressbar
        integer :: x,y,width,height, oldcolor, progress
        type(fillsettingstype) :: oldfill
    end type progressbar
    
    type(progressbar) :: pb
    
contains

    ! set some values once, so i just have to pass the progress in args later.
    subroutine init_progressbar(x,y,width,height, progress)
        use appgraphics, only : getcolor
        implicit none        
        integer, intent(in) :: x,y,width,height
        integer, optional :: progress
    
        pb%x = x
        pb%y = y
        pb%width = width
        pb%height = height        
        pb%oldcolor = getcolor()
        
        pb%progress = 0                                 ! default value
        if(present(progress)) pb%progress = progress    ! overiden if specified in argument
    end subroutine

    ! update the progress value, cap it between [1,100]
    subroutine set_progressbar(progress)
        implicit none
        integer, intent(in) :: progress
        pb%progress = progress
        if(pb%progress &lt; 1) pb%progress = 1
        if(pb%progress &gt; 100) pb%progress = 100
    end subroutine
    
    ! i never used it but ... nice to have a get/set
    function get_progressbar() result(progress)
        implicit none
        integer :: progress
        progress = pb%progress
    end function

    ! draw the progress bar, the result isn&#039;t very nice but it works.    
    subroutine draw_progressbar()
        use appgraphics
        implicit none
        integer :: bar_size

        bar_size = ((pb%progress / 100.0) * pb%width) + 1        
        pb%oldcolor = getcolor()
        call getfillsettings(pb%oldfill)

        call setcolor(BLACK)
        call rectangle(pb%x, pb%y, pb%x + pb%width, pb%y + pb%height)
        call setcolor(pb%oldcolor)
        call setfillstyle(SOLID_FILL, LIGHTGREEN)
        call bar(pb%x + 2, pb%y +1, (pb%x + bar_size) - 1, (pb%y + pb%height))
        call setcolor(pb%oldcolor)
        call setfillstyle(pb%oldfill%pattern, pb%oldfill%color )
        
    end subroutine
    
end module</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (ker2x)]]></author>
			<pubDate>Sun, 15 Sep 2019 11:03:02 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=3329#p3329</guid>
		</item>
		<item>
			<title><![CDATA[usage of getfillsettings SF2.41]]></title>
			<link>http://forums.approximatrix.com/viewtopic.php?pid=3328#p3328</link>
			<description><![CDATA[<p>Friendly greetings !</p><p>i have a code that need to get the current fill setting and color , do stuff, restore how it was before.</p><p>But i&#039;m stuck, there is no setfillsettings ...</p><div class="codebox"><pre><code>        pb%oldcolor = getcolor()
        call getfillsettings(pb%oldfill)

        call setcolor(BLACK)
        ! do some drawing

        call setfillstyle(SOLID_FILL, LIGHTGREEN)
        ! do some drawing

        ! restore previous values
        call setcolor(pb%oldcolor)
        call ??? ! there is no setfillsettings</code></pre></div><p>i tried just in case it was just missing documentation but : <br />undefined reference to `setfillsettings_&#039;<br />collect2.exe: error: ld returned 1 exit status</p><p>thank you.</p>]]></description>
			<author><![CDATA[null@example.com (ker2x)]]></author>
			<pubDate>Sun, 15 Sep 2019 10:50:17 +0000</pubDate>
			<guid>http://forums.approximatrix.com/viewtopic.php?pid=3328#p3328</guid>
		</item>
	</channel>
</rss>
