Password generator: Difference between revisions

No edit summary
Line 2,098:
<syntaxhighlight lang="futurebasic">
output file "Password Generator"
 
include "Tlbx GameplayKit.incl"
 
Line 2,123 ⟶ 2,122:
_window = 1
begin enum output 1
_optionsLabel
_pwLengthLabel
_pwLengthField
_pwAmountLabel
_pwAmountField
_passwordScroll
_passwordView
_offscreenPrintView
_createPasswordsBtn
_optionsHelp
_checkOmitIs
Line 2,139 ⟶ 2,132:
_charactersLongLabel
_passwordLengthField
_pwAmountLabel
_pwAmountField
_seedLabel
_seedField
_saveBtn
_printBtn
_helpBtn
_bottomLine
_saveBtn
_printBtn
_createPasswordsBtn
end enum
 
Line 2,153 ⟶ 2,149:
 
_savePanel = 1
_helpAlert = 1
_pwLenAlert = 2
 
Line 2,176 ⟶ 2,171:
 
void local fn BuildWindow
long tag
CGRect r = fn CGRectMake( 0, 0, 672, 460 )
window _window, @"Rosetta Code Password Generator", r//, NSWindowStyleMaskTitled + NSWindowStyleMaskClosable + NSWindowStyleMaskMiniaturizable
WindowSetContentMinSize( _window, fn CGSizeMake(310,386) )
r = fn CGRectMake( 20, 73, 515, 370 )
scrollview _passwordScroll, r, NSLineBorder,,_window
ViewSetAutoresizingMask( _passwordScroll, NSViewWidthSizable + NSViewHeightSizable )
textview _passwordView, r, _passwordScroll,, _window
Line 2,237 ⟶ 2,236:
ControlSetFormat( _seedField, @"0123456789", YES, 6, 0 )
ViewSetToolTip( _seedField, @"Enter optional random seed number." )
for tag = _optionsHelp to _seedField
ViewSetAutoresizingMask( tag, NSViewMinXMargin + NSViewMinYMargin )
next
r = fn CGRectMake( 631, 70, 25, 25 )
button _helpBtn, YES,,, r, NSButtonTypeMomentaryLight, NSBezelStyleHelpButton, _window
ViewSetToolTip( _helpBtn, @"Click for application help instructions." )
ViewSetAutoresizingMask( _helpBtn, NSViewMinXMargin + NSViewMaxYMargin )
r = fn CGRectMake( 20, 55, 632, 5 )
box _bottomline,, r, NSBoxSeparator
ViewSetAutoresizingMask( _bottomline, NSViewWidthSizable + NSViewMaxYMargin )
r = fn CGRectMake( 52220, 15, 13162, 32 )
button _createPasswordsBtn_printBtn, YES, , @"Create passwordsPrint…", r, NSButtonTypeMomentaryLight, NSBezelStyleRegularSquare, _window
ViewSetAutoresizingMask( _printBtn, NSViewMaxXMargin + NSViewMaxYMargin )
r = fn CGRectMake( 91, 15, 62, 32 )
button _saveBtn, YES, , @"Save…", r, NSButtonTypeMomentaryLight, NSBezelStyleRegularSquare, _window
ViewSetAutoresizingMask( _saveBtn, NSViewMaxXMargin + NSViewMaxYMargin )
r = fn CGRectMake( 20522, 15, 62131, 32 )
button _printBtn_createPasswordsBtn, YES, , @"Print…Create passwords", r, NSButtonTypeMomentaryLight, NSBezelStyleRegularSquare, _window
ViewSetAutoresizingMask( _createPasswordsBtn, NSViewMinXMargin + NSViewMaxYMargin )
r = fn CGRectMake( 631, 70, 25, 25 )
button _helpBtn, YES,,, r, NSButtonTypeMomentaryLight, NSBezelStyleHelpButton, _window
ViewSetToolTip( _helpBtn, @"Click for application help instructions." )
end fn
 
Line 2,400 ⟶ 2,408:
end fn
 
// Build character arrays at launch and save as application property
 
void local fn CreateCharactersDictionary
CFArrayRef charArray = @[¬
Line 2,460 ⟶ 2,468:
{{output}}
[[File:Password Generator.png]]
 
 
 
=={{header|Gambas}}==
717

edits