Tool button without Picture clause

Moderator: Rathinagiri

Post Reply
User avatar
Rathinagiri
Posts: 5181
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 141 times
Been thanked: 131 times
Contact:

Tool button without Picture clause

Post by Rathinagiri » Sat Nov 14, 2009 12:57 am

Should a tool button have picture definitely? Can't we omit the same?

In this toolbar_2 sample, I had omitted the picture for button 3_c and it gives run time error. :(

Code: Select all

/*
 * MINIGUI - Harbour Win32 GUI library Demo
 *
 * Copyright 2002 Roberto Lopez <harbourminigui@gmail.com>
 * http://harbourminigui.googlepages.com/
*/

#include "minigui.ch"

Function Main

	DEFINE WINDOW Form_1 ;
		AT 0,0 ;
		WIDTH 640 HEIGHT 480 ;
		TITLE 'MiniGUI ToolBar Demo' ;
		ICON 'DEMO.ICO' ;
		MAIN ;
		FONT 'Arial' SIZE 10 

		DEFINE STATUSBAR
			STATUSITEM 'HMG Power Ready!' 
		END STATUSBAR

		DEFINE MAIN MENU 
			POPUP '&File'
				ITEM 'Get ToolBar_3 Button_1'	    ACTION MsgInfo ( if ( Form_1.Button_1c.Value , '.T.' , '.F.' ) , 'Button_1c' )
				ITEM 'Get ToolBar_3 Button_2'	    ACTION MsgInfo ( if ( Form_1.Button_2c.Value , '.T.' , '.F.' ) , 'Button_2c' )
				ITEM 'Get ToolBar_3 Button_3'	    ACTION MsgInfo ( if ( Form_1.Button_3c.Value , '.T.' , '.F.' ) , 'Button_3c' )
				ITEM 'Get ToolBar_3 Button_4'	    ACTION MsgInfo ( if ( Form_1.Button_4c.Value , '.T.' , '.F.' ) , 'Button_4c' )
	    			SEPARATOR	
				ITEM 'Set ToolBar_3 Button_1'	    ACTION Form_1.Button_1c.Value := .T. 
				ITEM 'Set ToolBar_3 Button_2'	    ACTION Form_1.Button_2c.Value := .T. 
				ITEM 'Set ToolBar_3 Button_3'	    ACTION Form_1.Button_3c.Value := .T. 
				ITEM 'Set ToolBar_3 Button_4'	    ACTION Form_1.Button_4c.Value := .T. 
			    	SEPARATOR	
				ITEM '&Exit'			ACTION Form_1.Release
			END POPUP
			POPUP '&Help'
				ITEM '&About'		ACTION MsgInfo ("MiniGUI ToolBar demo") 
			END POPUP
		END MENU

		DEFINE SPLITBOX 

			DEFINE TOOLBAR ToolBar_a BUTTONSIZE 45,40 FONT 'Arial' SIZE 8  FLAT

				BUTTON Button_1a ;
					CAPTION '&Undo' ;
					PICTURE 'button4.bmp' ;
					ACTION MsgInfo('Click! 1')

				BUTTON Button_2a ;
					CAPTION '&Save' ;
					PICTURE 'button5.bmp' ;
					WHOLEDROPDOWN 

					DEFINE DROPDOWN MENU BUTTON Button_2a 
						ITEM 'Exit'	ACTION Form_1.Release
						ITEM 'About'	ACTION MsgInfo ("MiniGUI ToolBar Demo") 
					END MENU

				BUTTON Button_3a ;
					CAPTION '&Close' ;
					PICTURE 'button6.bmp' ;
					ACTION MsgInfo('Click! 3') ;
					DROPDOWN

					DEFINE DROPDOWN MENU BUTTON Button_3a 
						ITEM 'Disable ToolBar 1 Button 1'	ACTION Form_1.Button_1a.Enabled := .F.
						ITEM 'Enable ToolBar 1 Button 1'	ACTION Form_1.Button_1a.Enabled := .T.
					END MENU

			END TOOLBAR

			DEFINE TOOLBAR ToolBar_b BUTTONSIZE 45,40 FONT 'ARIAL' SIZE 8 FLAT 

				BUTTON Button_1b ;
					CAPTION 'More ToolBars...' ;
					PICTURE 'button7.bmp' ;
					ACTION MsgInfo('Click! 2'); 

				BUTTON Button_2b ;
					CAPTION 'Button 2' ;
					PICTURE 'button8.bmp' ;
					ACTION MsgInfo('Click! 2'); 
					SEPARATOR

				BUTTON Button_3b ;
					CAPTION 'Button 3' ;
					PICTURE 'button7.bmp' ;
					ACTION MsgInfo('Click! 3')

			END TOOLBAR

			DEFINE TOOLBAR ToolBar_c BUTTONSIZE 45,40 FONT 'Arial' SIZE 8 CAPTION 'ToolBar 3' FLAT

				BUTTON Button_1c ;
					CAPTION 'Check 1' ;
					PICTURE 'button4.bmp' ;
					ACTION MsgInfo('Hey!');
					CHECK GROUP

				BUTTON Button_2c ;
					CAPTION 'Check 2' ;
					PICTURE 'button5.bmp' ;
					ACTION MsgInfo('Hey!') ; 
					CHECK GROUP

				BUTTON Button_3c ;
					CAPTION 'Check 3' ;
					ACTION MsgInfo('Hey!') ;
					SEPARATOR;
					CHECK GROUP

				BUTTON Button_4c ;
					CAPTION 'Help Check' ;
					PICTURE 'button9.bmp' ;
					ACTION MsgInfo('Hey!') ;
					CHECK 

			END TOOLBAR

		END SPLITBOX

	END WINDOW

	CENTER WINDOW Form_1

	ACTIVATE WINDOW Form_1

Return Nil


East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
Roberto Lopez
HMG Founder
Posts: 3902
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 137 times

Post by Roberto Lopez » Sat Nov 14, 2009 1:10 am

rathinagiri wrote:Should a tool button have picture definitely? Can't we omit the same?

In this toolbar_2 sample, I had omitted the picture for button 3_c and it gives run time error. :(
It's true.

Toolbar code could be changed to allow mixed toolbars with image buttons and non-image buttons work properly.

I'll work on it.
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Roberto Lopez
HMG Founder
Posts: 3902
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 137 times

Post by Roberto Lopez » Sat Nov 14, 2009 2:34 am

Roberto Lopez wrote:
rathinagiri wrote:Should a tool button have picture definitely? Can't we omit the same?

In this toolbar_2 sample, I had omitted the picture for button 3_c and it gives run time error. :(
It's true.

Toolbar code could be changed to allow mixed toolbars with image buttons and non-image buttons work properly.

I'll work on it.
Replacing c_toolbar.c and h_toolbar.prg with attached versions you could omit pictures on buttons.

Anyway, I guess that this is not a good thing.
Attachments
TOOLBAR.RAR
(6.82 KiB) Downloaded 147 times
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

User avatar
Rathinagiri
Posts: 5181
Joined: Tue Jul 29, 2008 6:30 pm
DBs Used: MariaDB, SQLite, SQLCipher and MySQL
Location: Sivakasi, India
Has thanked: 141 times
Been thanked: 131 times
Contact:

Post by Rathinagiri » Sat Nov 14, 2009 5:31 am

Oh. Thanks Roberto.
Anyway, I guess that this is not a good thing.
Again thanks for pointing out Roberto. I would specify a picture rather. :)
East or West HMG is the Best.
South or North HMG is worth.
...the possibilities are endless.

User avatar
Roberto Lopez
HMG Founder
Posts: 3902
Joined: Wed Jul 30, 2008 6:43 pm
Has thanked: 13 times
Been thanked: 137 times

Post by Roberto Lopez » Sat Nov 14, 2009 1:38 pm

rathinagiri wrote:Oh. Thanks Roberto.
Anyway, I guess that this is not a good thing.
Again thanks for pointing out Roberto. I would specify a picture rather. :)
Ok. :)

In fact this error checking comes from a ToolBar bug report.

Someone reported a malfunction in ToolBar, but the fact was that the picture was missed :)
Regards/Saludos,

Roberto


(Veritas Filia Temporis)

Post Reply