forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Call back functions for winio@

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Wed Aug 06, 2014 5:34 am    Post subject: Call back functions for winio@ Reply with quote

Hi

I have tried the following small function to display simple messages and to take the response based on [Ok] & [Cancel] Button. This works fine for pressing [Ok] button, but for [Cancel] button, it does not call the call back function. I have tried with ^bt[Cancel] also, but it is not call the func()

Here is the code :

Code:

module test

contains

subroutine display_msg(title,message)

  integer res, winio@
  character(len=*):: title, message
  common res
  res = winio@('%ca['//title//']&')
  res = winio@('%il&',1,2147483647)
  res = winio@(message//'%ta%^bt[OK]%ta%bt[Cancel]',func)
  !res = winio@('%ta%bt[OK]%ta%bt[Cancel]',func)
  print*, res

end subroutine display_msg

integer function func()
func = (-1)
print*, 'I am in function'
print*, func
print*, 'control returns to main'
end function

end module test


winapp
program main
use test
!external display_msg
character (len=50) :: title, message
integer :: res
common res
title='Format Error'
message ='Bus Data is a problem..Program stopping'
call display_msg(title,message)
if (res == 1) print*, 'Ok is pressed'
if (res == 2 ) print*, 'Cancel is pressed'
end program


Can I request your help to fix this.

The idea is to have a generic routine to display the user defined messages. Suitable other alternatives are most welcome.

Thanks
_________________
Thanks and Regards
Moorthy
Back to top
View user's profile Send private message
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Wed Aug 06, 2014 7:30 pm    Post subject: Reply with quote

All information messages should only have [OK]. The caption shouldn't contain the information - it should contain the name of your application because otherwise the user doesn't know which application triggered the message if they have multiple applications open.

You should read the Microsoft User Experience guidelines, otherwise your application won't be intuitive to experienced Windows users.

I answered your query regarding the standard icon in your other post - but you can also draw your own icons and place them - you can use %gi to place GIFs (which can be animated), %ic to place windows icons, %bm to place bitmaps (various types) etc. You can make such icons clickable.

E
Back to top
View user's profile Send private message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 142
Location: Chennai, IN

PostPosted: Thu Aug 07, 2014 5:22 am    Post subject: Reply with quote

Thanks a lot Eddie.
_________________
Thanks and Regards
Moorthy
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group