Using ProgressBar as a graph
Moderator: Rathinagiri
Using ProgressBar as a graph
Hi guys!
I want to use progressBar as graph.
Everything looks ok, when I set my windows screen setting for high performance
But, when I set screen settings for best quality, It looks bad!
The color of 4th progressbar becomes green (not red - as I seemed to be) and progressbars are not smooth!
Dou you have any concept why it looks worse in high quality settings?
Best regards, Marek
I want to use progressBar as graph.
Everything looks ok, when I set my windows screen setting for high performance
But, when I set screen settings for best quality, It looks bad!
The color of 4th progressbar becomes green (not red - as I seemed to be) and progressbars are not smooth!
Dou you have any concept why it looks worse in high quality settings?
Best regards, Marek
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Using ProgressBar as a graph
Because, in High Quality Settings, the progress bar control is over taken by the windows theme.
But, I like the concept and creativity of using Progress Bar as graph.
But, I like the concept and creativity of using Progress Bar as graph.
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Using ProgressBar as a graph
It has advantage of typical graph in simple application - you can use it on Tabs and it's easy to update them
Re: Using ProgressBar as a graph
Rathi, any idea how to skip windows themes in progress bar?
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Using ProgressBar as a graph
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Using ProgressBar as a graph
maybe something like "user defined component" - does exist in HMG?
I didn't found...
I didn't found...
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Using ProgressBar as a graph
Hi,
Here is a small utility to have customized progress bars.
Here is the screenshot.
Compile and use it.
Syntax is:
custom_progress_bar(cWindowName,nFromRow,nFromCol,nWidth,nHeight,aFillColor,nValue,nMax)
Here is a small utility to have customized progress bars.
Here is the screenshot.
Compile and use it.
Syntax is:
custom_progress_bar(cWindowName,nFromRow,nFromCol,nWidth,nHeight,aFillColor,nValue,nMax)
Code: Select all
# include "minigui.ch"
function main
define window sample at 0,0 width 1000 height 600 main
define button pressme
row 10
col 10
width 80
caption "Press Me!"
action docustomprogressbars()
end button
end window
sample.center
sample.activate
return nil
function docustomprogressbars
//Horizontal
custom_progress_bar("sample",100,100,300,25,{255,0,0},10,100)
custom_progress_bar("sample",150,100,300,25,{255,255,0},40,100)
custom_progress_bar("sample",200,100,300,25,{0,255,0},60,100)
custom_progress_bar("sample",250,100,300,25,{0,0,255},80,100)
//Vertical
custom_progress_bar("sample",300,150,25,250,{255,0,0},10,100)
custom_progress_bar("sample",300,200,25,250,{255,255,0},40,100)
custom_progress_bar("sample",300,250,25,250,{0,255,0},60,100)
custom_progress_bar("sample",300,300,25,250,{0,0,255},80,100)
return nil
function custom_progress_bar(cWindowName,nRow,nCol,nWidth,nHeight,aColor,nValue,nMax)
local nStartRow, nStartCol, nFinishRow, nFinishCol := 0
// Borders
DRAW RECTANGLE IN WINDOW &cWindowName AT nRow,nCol TO nRow+nHeight,nCol+nWidth PENCOLOR {255,255,255} FILLCOLOR {255,255,255}
DRAW LINE IN WINDOW &cWindowName At nRow,nCol to nRow+nHeight,nCol PENCOLOR {0,0,0} PENWIDTH 1
DRAW LINE IN WINDOW &cWindowName At nRow,nCol to nRow,nCol+nWidth PENCOLOR {0,0,0} PENWIDTH 1
//Progress Bar
if nWidth > nHeight // Horizontal Progress Bar
nStartRow := nRow + 1
nStartCol := nCol + 1
nFinishRow := nRow + nHeight - 1
nFinishCol := nCol + 1 + ((nWidth - 2) * nValue / nMax)
else // Vertical Progress Bar
nStartRow := nRow + nHeight - 1
nStartCol := nCol + 1
nFinishRow := nStartRow - ((nHeight - 2) * nValue / nMax)
nFinishCol := nCol + nWidth - 1
endif
DRAW RECTANGLE IN WINDOW &cWindowName AT nStartRow,nStartCol TO nFinishRow,nFinishCol PENCOLOR aColor FILLCOLOR aColor
return nil
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.
Re: Using ProgressBar as a graph
I'm not sure if it will works good in my project, because of TAB's that I'm using.
I'll test it tomorrow.
PS.
Some time ago, I've tried drawing on TABs and effects were strange
I'll test it tomorrow.
PS.
Some time ago, I've tried drawing on TABs and effects were strange
- Rathinagiri
- Posts: 5471
- Joined: Tue Jul 29, 2008 6:30 pm
- DBs Used: MariaDB, SQLite, SQLCipher and MySQL
- Location: Sivakasi, India
- Contact:
Re: Using ProgressBar as a graph
Yes. It can't be used in TABs.
However, we can have a work around.
See this code. I think it may be useful for you.
However, we can have a work around.
See this code. I think it may be useful for you.
Code: Select all
# include "minigui.ch"
function main
define window sample at 0,0 width 1000 height 600 main
define button pressme
row 10
col 10
width 80
caption "Press Me!"
action docustomprogressbars()
end button
define tab t1 at 50,5 width 900 height 520 on change checkgraph()
define page "Page 1"
end page
define page "Page 2"
end page
end tab
end window
sample.center
sample.activate
return nil
function docustomprogressbars
if sample.t1.value == 2
custom_progress_bar("sample",100,100,300,25,{255,0,0},10,100)
custom_progress_bar("sample",150,100,300,25,{255,255,0},40,100)
custom_progress_bar("sample",200,100,300,25,{0,255,0},60,100)
custom_progress_bar("sample",250,100,300,25,{0,0,255},80,100)
custom_progress_bar("sample",300,150,25,250,{255,0,0},10,100)
custom_progress_bar("sample",300,200,25,250,{255,255,0},40,100)
custom_progress_bar("sample",300,250,25,250,{0,255,0},60,100)
custom_progress_bar("sample",300,300,25,250,{0,0,255},80,100)
endif
return nil
function checkgraph
if sample.t1.value == 2
docustomprogressbars()
else
erase window sample
endif
return nil
function custom_progress_bar(cWindowName,nRow,nCol,nWidth,nHeight,aColor,nValue,nMax)
local nStartRow, nStartCol, nFinishRow, nFinishCol := 0
// borders
DRAW RECTANGLE IN WINDOW &cWindowName AT nRow,nCol TO nRow+nHeight,nCol+nWidth PENCOLOR {255,255,255} FILLCOLOR {255,255,255}
DRAW LINE IN WINDOW &cWindowName At nRow,nCol to nRow+nHeight,nCol PENCOLOR {0,0,0} PENWIDTH 1
DRAW LINE IN WINDOW &cWindowName At nRow,nCol to nRow,nCol+nWidth PENCOLOR {0,0,0} PENWIDTH 1
// progress bar
if nWidth > nHeight // Horizontal Progress Bar
nStartRow := nRow + 1
nStartCol := nCol + 1
nFinishRow := nRow + nHeight - 1
nFinishCol := nCol + 1 + ((nWidth - 2) * nValue / nMax)
else // Vertical Progress Bar
nStartRow := nRow + nHeight - 1
nStartCol := nCol + 1
nFinishRow := nStartRow - ((nHeight - 2) * nValue / nMax)
nFinishCol := nCol + nWidth - 1
endif
DRAW RECTANGLE IN WINDOW &cWindowName AT nStartRow,nStartCol TO nFinishRow,nFinishCol PENCOLOR aColor FILLCOLOR aColor
return nil
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.
South or North HMG is worth.
...the possibilities are endless.