It is currently Sat Dec 16, 2017 7:42 pm

All times are UTC + 1 hour




Post new topic Reply to topic  [ 240 posts ]  Go to page Previous  1 ... 12, 13, 14, 15, 16
Author Message
 Post subject: Re: Create your own icons for toolbars etc. with PureBasic
PostPosted: Sat Mar 11, 2017 4:32 pm 
Offline
Addict
Addict
User avatar

Joined: Tue Nov 09, 2010 10:15 pm
Posts: 1487
If you are going to do that, perhaps rename the arrows: instead of "UpArrow", "DownArrow", rename to ArrowUp and ArrowDown? Would be an easy way to standardize the naming method.


Top
 Profile  
Reply with quote  
 Post subject: Re: Create your own icons for toolbars etc. with PureBasic
PostPosted: Mon Mar 13, 2017 6:16 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3142
Location: Berlin, Germany
Tenaja wrote:
If you are going to do that, perhaps rename the arrows: instead of "UpArrow", "DownArrow", rename to ArrowUp and ArrowDown? Would be an easy way to standardize the naming method.

For instance, in Unicode there are symbols called "Upwards Arrow" and "Downwards Arrow"; in LaTeX there are symbols called "\uparrow" and "\downarrow"; in a renowned programming language there are mathematical functions called "UpArrow()" and "DownArrow()".
So I think it's OK to leave these arrow names as they are now.

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: Create your own icons for toolbars etc. with PureBasic
PostPosted: Mon Mar 13, 2017 6:25 am 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 2489
Location: Boston, MA
Things are not correct because "everybody" does it.
'Noun - Verb' is more orderly and efficient when searching.
I care not about 'Up Aardvark' when scanning for 'Up Arrow'.
Grouping all Arrow methods is just logical.
Vulcan out :wink:

_________________
Intelligence is like underwear. It is important to have it, but showing it to the wrong people has the tendency to make them feel uncomfortable. ~ Angela Johnson


Top
 Profile  
Reply with quote  
 Post subject: Re: Create your own icons for toolbars etc. with PureBasic
PostPosted: Mon Mar 13, 2017 6:33 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3142
Location: Berlin, Germany
skywalk wrote:
Things are not correct because "everybody" does it.

... and I never wrote that.
BTW: Things are not wrong just because someone says so. :-)

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: Create your own icons for toolbars etc. with PureBasic
PostPosted: Fri Mar 17, 2017 7:55 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3142
Location: Berlin, Germany
Current changes (2017-03-17)
  • Since there have been no objections in about 1 week, the names of all chess icons were prefixed by "Chess_".

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: Create your own icons for toolbars etc. with PureBasic
PostPosted: Sat Mar 18, 2017 6:40 am 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Fri Oct 06, 2006 4:41 am
Posts: 579
Location: Canada
Little John wrote:
Current changes (2017-03-17)

Thank you, Little John, for the continuing updates.
Much appreciated.

Is it only my impression, or did the conversation about icon naming quickly turned south ?
If it stopped abruptly, it's too bad, because, independently of how other programming languages name things, Tenaja and skywalk made valid points.

It's indeed easier to follow and recognize how code is structured when the naming scheme used follows the pattern
[main part non-changing] + [qualifying part varying].
Granted, it hurts our normal perception and use of human language, but it makes sense in computer logics.

The usual UpArrow and DownArrow are very clear, and they come naturally, since they are descriptive and follow natural speech patterns.
But ArrowUp and ArrowDown (or Aardvark_slow and Aardvark_fast) :shock: (you'll have to ask skywalk...) present the advantages of better documenting the built-in logics of the code, and being easier to sort.

Same with DrawBox_rounded and DrawBox_square rather than DrawRoundedBox and DrawSquareBox .
The latter are crystal clear about their purpose in life, but the former emphasize better the internal structure of the code and the logical relationship of things, whether they be icon names, functions, procedures or code sections. And, again, they're easier to search and sort.

In fact, this is exactly the same debate as with the numeric representation of dates. Every nation is attached to its date representation format, but in the end, from a computing perspective, the only format that makes sense is the ISO format [yyyy-mm-dd] because it's the only one that can be sorted without any confusion, using either alphabetical or numerical sorting algorithms. Try it within a Windows Explorer folder, and you'll see.

In the end, it's a matter of preference.
But some preferences have intrinsic advantages that may be interesting to adopt.
Just think of the metric system...

_________________
"That's not a bug..." said the programmer. "...It's a feature! "
"Oh! I see..." replied the blind man.


Top
 Profile  
Reply with quote  
 Post subject: Re: Create your own icons for toolbars etc. with PureBasic
PostPosted: Sat Mar 18, 2017 7:44 am 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3142
Location: Berlin, Germany
Hello Blue.

Blue wrote:
In the end, it's a matter of preference.

Yes, it is. :-)

Blue wrote:
But some preferences have intrinsic advantages that may be interesting to adopt.
Just think of the metric system...

I absolutely agree with what you wrote about dates, and guess why I'm always using the ISO date format in my posts and in the comments of my source code. :-)
However, choosing names is different from choosing a date format. And I'm sorry, I don't understand what the meaning of the metric system is in this context.

As you know, I have not been active here on the forum for several months. I did not plan to "come back" to the forum by now. I only did do so because of your recent feature requests for this project. Unfortunately, my spare time is still very limited, and I'll have to limit my activities on this forum to things which I really consider important. Sorry, discussing about naming preferences at length is not among them.

(Of course, I'll rename any icon if this is explicitly requested by its creator.)

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: Create your own icons for toolbars etc. with PureBasic
PostPosted: Sun Apr 23, 2017 6:16 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3142
Location: Berlin, Germany
Current changes (2017-04-23)
Just some small changes in the file "vectoriconbrowser.pb".
  • One step of zooming does not mean multiplying/dividing the length of the icon edges by 2 anymore, but now it means adding/subtracting 8 pixels to/from the length of each edge.
  • The default icon size was reduced from 32x32 to 24x24, so that it's now a bit more convenient to generate PNG icon files for PureBasic's toolbars when using the new #PB_ToolBar_Large flag.
  • some other minor changes

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: Create your own icons for toolbars etc. with PureBasic
PostPosted: Thu Jul 20, 2017 12:31 pm 
Offline
Enthusiast
Enthusiast
User avatar

Joined: Tue Jul 13, 2004 2:17 pm
Posts: 171
Wow, cool work. Thanks for that...

_________________
Bye Karl


Top
 Profile  
Reply with quote  
 Post subject: Re: Create your own icons for toolbars etc. with PureBasic
PostPosted: Thu Jul 20, 2017 4:23 pm 
Offline
Addict
Addict

Joined: Fri Nov 09, 2012 11:04 pm
Posts: 1465
Location: Uttoxeter, UK
Hi Little John,
Thank you for keeping the hinges oiled, and, of course, the enhancements.

I have a few more icons in the works which I will post in the next few weeks.

_________________
DE AA EB


Top
 Profile  
Reply with quote  
 Post subject: Re: Create your own icons for toolbars etc. with PureBasic
PostPosted: Thu Jul 20, 2017 4:58 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3142
Location: Berlin, Germany
Hi davido,

very cool. 8)
Many thanks in advance!

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: Create your own icons for toolbars etc. with PureBasic
PostPosted: Sun Aug 27, 2017 12:34 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3142
Location: Berlin, Germany
Most recent changes:

2017-08-27
New great stuff from Oma (1st icon set):
  • 30 flags
  • 7 other icons
  • several new color definitions

Thank you very much!

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: Create your own icons for toolbars etc. with PureBasic
PostPosted: Thu Nov 02, 2017 12:12 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Apr 26, 2003 2:49 pm
Posts: 505
Really great work, thanks.

How can i make the icon image smaller within the given size?
For example in the MediaFastBack() icon if i change the line:
Code:
w = size / 8.0

to:
Code:
w = size / 16.0

The arrows are half of the side, that is what i need, but they are not centered in the icon.
I need this because i want to draw a circle around the arrows so they have to be smaller.

So it would be great some option or zoom factor for the image inside the icon.
Or an example of how to center the smaller image inside the icon, i played a bit but i have no idea where all those magic numbers come, here is the code:
Code:
  Procedure.i MediaFastBack (file$, img.i, size.i, color.i)
      ; in : file$: name of SVG file which is to be created (only supported on Linux),
      ;             or "" for creating an image in memory
      ;      img  : number of the image which is to be created, or #PB_Any
      ;      size : width and height (number of pixels)
      ;      color: foreground color
      ; out: return value: if img = #Pb_Any --> number of the created image,
      ;                    on error --> 0
      ; [by infratec]
      Protected ret.i, w.d
     
      ;Changed size here from 8.0 to 16.0
      w = size / 16.0 ;8.0
     
      ret = StartVectorIconOutput(file$, img, size)
     
      If ret
         VectorSourceColor(color)
         
         MovePathCursor(4*w, w)
         AddPathLine(w, 4*w)
         AddPathLine(4*w, 7*w)
         StrokePath(1.5*w, #PB_Path_RoundCorner)
         
         MovePathCursor(7*w, w)
         AddPathLine(4*w, 4*w)
         AddPathLine(7*w, 7*w)
         StrokePath(1.5*w, #PB_Path_RoundCorner)
         
         StopVectorDrawing()
      EndIf
     
      ProcedureReturn ret
   EndProcedure


Top
 Profile  
Reply with quote  
 Post subject: Re: Create your own icons for toolbars etc. with PureBasic
PostPosted: Thu Nov 02, 2017 5:58 pm 
Offline
Addict
Addict
User avatar

Joined: Thu Jun 07, 2007 3:25 pm
Posts: 3142
Location: Berlin, Germany
Justin wrote:
I need this because i want to draw a circle around the arrows so they have to be smaller.

So it would be great some option or zoom factor for the image inside the icon.
Or an example of how to center the smaller image inside the icon

The format of the icon procedures in this library does not support the concept of freely adjustable margins.

However, you can easily reach your goal like this:
Load or create a background image, that has the desired size of your picture. The image can contain anything you want (e.g. just a monochrome or transparent background).
Then draw an icon from this library on the background image (see example program "icon on picture.pb" in the VectorIcons ZIP archive). Pass a value as 'size' parameter to the icon procedure (e.g. MediaFastBack()) which is small enough, so that there is sufficient space on the backgrond image for your circle.

_________________
Please excuse my flawed English. My native language is PureBasic.
Search
RSBasic's backups


Top
 Profile  
Reply with quote  
 Post subject: Re: Create your own icons for toolbars etc. with PureBasic
PostPosted: Fri Nov 03, 2017 8:15 pm 
Offline
Enthusiast
Enthusiast

Joined: Sat Apr 26, 2003 2:49 pm
Posts: 505
That would be a way, thanks.
I added a zoom param to the procedure to do it in one shot, i only use it to make it smaller, zoom < 1.
Needs more checks but works and centers the image. Passing 0.5 reduces the image half of the size.
Code:
   Procedure.i MediaFastForward (file$, img.i, size.i, color.i, zoom.d)
      ; in : file$: name of SVG file which is to be created (only supported on Linux),
      ;             or "" for creating an image in memory
      ;      img  : number of the image which is to be created, or #PB_Any
      ;      size : width and height (number of pixels)
      ;      color: foreground color
      ; out: return value: if img = #Pb_Any --> number of the created image,
      ;                    on error --> 0
      ; [by infratec]
      Protected ret.i, w.d, newsize, offsetX, offsetY
      
      w = size / 8.0
      
      ret = StartVectorIconOutput(file$, img, size)
      
      If ret
         newsize = size * zoom
         If newsize < size
            offsetX = (size - newsize) / 2
            offsetY = offsetX
            
           TranslateCoordinates(offsetX, offsetY)
           ScaleCoordinates(zoom, zoom)
         EndIf
         
         VectorSourceColor(color)
         
         MovePathCursor(w, w)
         AddPathLine(4*w, 4*w)
         AddPathLine(w, 7*w)
         StrokePath(1.5*w, #PB_Path_RoundCorner)
         
         MovePathCursor(4*w, w)
         AddPathLine(7*w, 4*w)
         AddPathLine(4*w, 7*w)
         StrokePath(1.5*w, #PB_Path_RoundCorner)
         
         StopVectorDrawing()
      EndIf
      
      ProcedureReturn ret
   EndProcedure


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 240 posts ]  Go to page Previous  1 ... 12, 13, 14, 15, 16

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye