Finale PDK Framework  0.54
ff_dialogs.h
1 /*
2  * File: ff_dialogs.h
3  * Author: Jari Williamsson
4  *
5  * Created on den 24 januari 2011, 10:02
6  */
7 
8 #ifndef FF_DIALOGS_H
9 #define FF_DIALOGS_H
10 
11 #include "ff_basecollection.h"
12 #if OPERATING_SYSTEM == MAC_OS
13 #include <finaleframework_cocoa.h>
14 #include <ff_cocoa_cppinterface.h>
15 #endif
16 #ifdef PDK_FRAMEWORK_CANVASCTRL
17 #include "ff_fcctrlcanvas.h"
18 #endif
19 
20 #ifdef PDK_FRAMEWORK_FILEDIALOGS
21 
22 /* Tech info: Since the file/folder dialogs on Windows requires the -lcomdlg32 and -lole32
23  * linker options to be set in MinGW, these classes require a
24  * dedicated #define.
25  *
26  * */
27 
28 
41 {
42 protected:
43 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
44  FCUI* _pUI;
45  FCStrings _filters; /* List of strings with filters, such as "*.txt" or "*.*" */
46  FCStrings _filterdescriptions; /* The number of filter description match the filters */
47  int _defaultfilterindex;
48  FCString _windowtitle;
49  FCString _filename;
50  FCString _initfolder;
51 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
52 public:
55  {
56  _pUI = pUI;
57  _defaultfilterindex = 0;
58  }
59 
72  void AddFilter(FCString* pFilter, FCString* pFilterDescription)
73  {
74  if (!pFilter) return;
75  if (!pFilterDescription) return;
76  FCString* pNewString = new FCString();
77  pNewString->SetString(pFilter);
78  _filters.Add(pNewString);
79  pNewString = new FCString();
80  pNewString->SetString(pFilterDescription);
81  _filterdescriptions.Add(pNewString);
82  }
83 
87  FCStrings* _GetFilters() { return &_filters; }
88 
95  void SetDefaultFilter(int index)
96  {
97  if (index < 0) return;
98  if (index >= _filters.GetCount()) return;
99  _defaultfilterindex = index;
100  }
101 
106  void SetWindowTitle(FCString* pString)
107  {
108  _windowtitle.SetString(pString);
109  }
110 
116  void SetFileName(FCString* pString)
117  {
118  _filename.SetString(pString);
119  }
120 
132  void SetInitFolder(FCString* pString)
133  {
134  _initfolder.SetString(pString);
135  }
136 
142  void GetWindowTitle(FCString* pString)
143  {
144  if (!pString) return;
145  pString->SetString(&_windowtitle);
146  }
147 
153  void GetFileName(FCString* pString)
154  {
155  if (!pString) return;
156  pString->SetString(&_filename);
157  }
158 
163  void GetInitFolder(FCString* pString)
164  {
165  if (!pString) return;
166  pString->SetString(&_initfolder);
167  }
168 
177  bool AssureFileExtension(const char* pszSuffix)
178  {
179  if (!pszSuffix) return false;
180  if (pszSuffix[0] != '.') return false;
181  FCString extension;
182  extension.SetString(&_filename);
183  extension.ExtractFileExtension();
184  if (extension.IsEmpty()) _filename.AppendCString(pszSuffix);
185  return true;
186  }
187 
190  virtual bool Execute() = 0;
191 };
192 
200 {
201  FCStrings _multifiles;
202  bool _multiselect;
203 public:
211  {
212  _multiselect = false;
213  }
214 
219  void SetMultiSelect(bool value) { _multiselect = value; }
220 
226  bool GetMultiSelect() const { return _multiselect; }
227 
228 
236  void GetFileNames(FCStrings* pStrings)
237  {
238  if (!pStrings) return;
239  pStrings->CopyFrom(&_multifiles);
240  }
241 
243  void _SetFileNames(FCStrings* pStrings)
244  {
245  _multifiles.CopyFrom(pStrings);
246  }
247 
254  virtual bool Execute();
255 };
256 
264 {
265 public:
270  {
271  }
272 
277  virtual bool Execute();
278 };
279 
291 {
292  bool _usefinaleapi; /* Use the native Finale API on Finale 25+, defaults to ON. */
293  FCString _windowtitle;
294  FCString _folderpath; /* The folder path (in/out) */
295  FCUI* _pUI;
296 public:
304  {
305  _pUI = pUI;
306  _usefinaleapi = true;
307  }
308 
317  void SetFolderPath(FCString* pString) { _folderpath.SetString(pString); }
318 
325  void SetWindowTitle(FCString* pString) { _windowtitle.SetString(pString); }
326 
338  void SetUseFinaleAPI(bool state) { _usefinaleapi = state; }
339 
346  void GetFolderPath(FCString* pString)
347  {
348  if (!pString) return;
349  pString->SetString(&_folderpath);
350  }
351 
358  void GetWindowTitle(FCString* pString)
359  {
360  if (!pString) return;
361  pString->SetString(&_windowtitle);
362  }
363 
375  bool GetUseFinaleAPI() const { return _usefinaleapi; }
376 
386  bool Execute();
387 };
388 
389 #endif /* #ifdef PDK_FRAMEWORK_FILEDIALOGS */
390 
391 
392 #ifdef PDK_FRAMEWORK_DIALOGS
393 
394 /* Some forward class declarations */
395 class FCControl;
396 class FCCtrlDataList;
397 class FCCtrlSwitcher;
398 
399 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
400 
401 
402 struct _NONWINDOW_PROPERTY_VOIDPTR
403 {
404  void* pValue;
405  bool has_been_set;
406 
407  _NONWINDOW_PROPERTY_VOIDPTR()
408  {
409  pValue = NULL;
410  has_been_set = false;
411  }
412 
413  void SetValue(void* pNewValue) {
414  pValue = pNewValue;
415  has_been_set = true;
416  }
417 };
418 
419 struct _NONWINDOW_PROPERTY_FCSTRING
420 {
421  FCString value;
422  bool has_been_set;
423 
424  _NONWINDOW_PROPERTY_FCSTRING()
425  {
426  value.Clear();
427  has_been_set = false;
428  }
429 
430  void SetValue(FCString* pNewString) {
431  value.SetString(pNewString);
432  has_been_set = true;
433  }
434 
435  void SetIntegerValue(int anint) {
436  value.SetInteger(anint);
437  has_been_set = true;
438  }
439 
440  void SetMeasurementValue(double measurement, twobyte measurementunit) {
441  value.SetMeasurement(measurement, measurementunit);
442  has_been_set = true;
443  }
444 };
445 
446 struct _NONWINDOW_PROPERTY_FCSTRINGS
447 {
448  FCStrings value;
449  bool has_been_set;
450 
451  _NONWINDOW_PROPERTY_FCSTRINGS()
452  {
453  value.ClearAll();
454  has_been_set = false;
455  }
456 
457  void AppendString(FCString* pString)
458  {
459  value.AddCopy(pString);
460  has_been_set = true;
461  }
462 
463  void ClearAll()
464  {
465  value.ClearAll();
466  has_been_set = true;
467  }
468 };
469 
470 struct _NONWINDOW_PROPERTY_FCNUMBERS
471 {
472  FCNumbers value;
473  bool has_been_set;
474 
475  _NONWINDOW_PROPERTY_FCNUMBERS()
476  {
477  value.ClearAll();
478  has_been_set = false;
479  }
480 
481  void AppendInt(int anint)
482  {
483  value.AddInt(anint);
484  has_been_set = true;
485  }
486 
487  void AppendFloat(float afloat)
488  {
489  value.AddFloat(afloat);
490  has_been_set = true;
491  }
492 
493  void ClearAll()
494  {
495  value.ClearAll();
496  has_been_set = true;
497  }
498 };
499 
500 struct _NONWINDOW_PROPERTY_BOOL
501 {
502  bool value;
503  bool has_been_set;
504 
505  _NONWINDOW_PROPERTY_BOOL()
506  {
507  value = false;
508  has_been_set = false;
509  }
510 
511  void SetValue(bool newvalue) {
512  value = newvalue;
513  has_been_set = true;
514  }
515 };
516 
517 struct _NONWINDOW_PROPERTY_INT
518 {
519  int value;
520  bool has_been_set;
521 
522  _NONWINDOW_PROPERTY_INT()
523  {
524  value = 0;
525  has_been_set = false;
526  }
527 
528  void SetValue(int newvalue) {
529  value = newvalue;
530  has_been_set = true;
531  }
532 };
533 
534 struct _NONWINDOW_PROPERTY_FLOAT
535 {
536  float value;
537  bool has_been_set;
538 
539  _NONWINDOW_PROPERTY_FLOAT()
540  {
541  value = 0.0f;
542  has_been_set = false;
543  }
544 
545  void SetValue(float newvalue) {
546  value = newvalue;
547  has_been_set = true;
548  }
549 };
550 
551 
559 struct __FCUserWindow_NONWINDOWSTORAGE
560 {
561  _NONWINDOW_PROPERTY_FCSTRING title;
562  _NONWINDOW_PROPERTY_FLOAT width;
563  _NONWINDOW_PROPERTY_FLOAT height;
564  _NONWINDOW_PROPERTY_FLOAT clientheight;
565  _NONWINDOW_PROPERTY_FLOAT clientwidth;
566 };
567 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
568 
569 
577 {
578  /* Storage for the modifier keys held down at the last HandleCommand() event. */
579  FLAG_32 _lastcommandmodifierkeys;
580 
581 protected:
582 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
583 #if OPERATING_SYSTEM == WINDOWS
584  /* Conversion routines between pixels and points. These can't be private, since they
585  need to be accessible for FCCustomWindow as well. */
586 
588  float _WinHorizPixelsToPoints(float value);
589 
591  float _WinVertPixelsToPoints(float value);
592 
594  float _WinHorizPointsToPixels(float value);
595 
597  float _WinVertPointsToPixels(float value);
598 #endif
599 
600  /* Storage for the variables that will be available when the window handle isn't: */
601  __FCUserWindow_NONWINDOWSTORAGE nonwindow_store;
602 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
603 private:
604  twobyte _modalresult; /* The modal result ID (IDOK or IDCANCEL) */
605 
606 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
607 #if OPERATING_SYSTEM == MAC_OS
608 protected:
609  _FCWindowController_cocoa* _pCocoaLink;
610 #endif /* MAC_OS */
611 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
612 private:
613  bool _pointsmeasurement; /* If true, measurement/positioning is in points. Otherwise, in system-native units. */
614 #if OPERATING_SYSTEM == WINDOWS
615  HWND _hwnd; /* The standard Windows handle. */
616 #endif
617  float _maximumresizewidth;
618  float _minimumresizewidth;
619  float _maximumresizeheight;
620  float _minimumresizeheight;
621  float _oldresizewidth;
622  float _oldresizeheight;
623 
624  // Members for window position storage:
625  bool _positionstored;
626  float _storedxpos;
627  float _storedypos;
628  bool _sizestored;
629  float _storedwidth;
630  float _storedheight;
631 
632  // Members for window shade handling:
633  bool _isinwindowshademode;
634  float _nonwindowshadeheight;
635 
636  bool _bufferedcontrolmovement;
637 #if OPERATING_SYSTEM == WINDOWS
638  bool _initwindowcalled;
639  bool _restorepositioncalled;
640 #endif
641 
642 #if PDK_FRAMEWORK_DIAGNOSE
643 
647  void _CheckControls();
648 #endif
649 
650 protected:
651 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
652 
654  void _CreateDynamicControls();
655 
662  virtual void _InitNonWindowHandleStates();
663 
668  void _StoreNonWindowHandleStates();
669 
670  bool _ismodal;
671 
672  bool _closewindowcalled; /* To prevent multiple CloseWindow() calls
673  * which is bad on the Mac */
674 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
675 
677  twobyte GetModalResult() { return _modalresult; }
678 public:
680  void _SetLastCommandModifierKeys(FLAG_32 value) { _lastcommandmodifierkeys = value; }
681 
687  {
689  CMDMODKEY_SHIFT = 0x00000001,
690 
692  CMDMODKEY_ALT = 0x00000002,
693 
695  CMDMODKEY_CTRL = 0x00000004,
696 
698  CMDMODKEY_COMMAND = 0x00000008,
699 
701  CMDMODKEY_FUNCTION = 0x00000008
702  };
703 
704 
707  {
708  _lastcommandmodifierkeys = 0x0;
709  _pointsmeasurement = false;
710 #if OPERATING_SYSTEM == MAC_OS
711  _pCocoaLink = NULL;
712 #else
713  _hwnd = 0;
714 #endif
715  _ismodal = false;
716  _modalresult = 0;
717  _closewindowcalled = false;
718  _maximumresizewidth = _minimumresizewidth =
719  _maximumresizeheight = _minimumresizeheight =
720  _oldresizewidth = _oldresizeheight = 0;
721  _positionstored = _sizestored = false;
722  _isinwindowshademode = false;
723  _nonwindowshadeheight = 0;
724  WINCODE(_initwindowcalled = false;)
725  WINCODE(_restorepositioncalled = false;)
726  _bufferedcontrolmovement = false;
727  }
728 
735  {
736  return _pointsmeasurement;
737  }
738 
740  bool IsModal() { return _ismodal; }
741 
742 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
743 
744  void _WinStoreModifierKeys();
745 
746  void _SetPointsMeasurement(bool use_points)
747  {
748  _pointsmeasurement = use_points;
749  }
750 
752  void _SetModalResult(twobyte modalresultid) { _modalresult = modalresultid; }
753 
754  bool _GetCloseWindowCalled() { return _closewindowcalled; }
755 
761  void _HandleResizeChange(int newwidth, int newheight);
762 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
763 
767  void SetEnabled(bool state);
768 
773  FCControl* GetItemAt(int index) { return (FCControl*) __FCCollection::GetItemAt(index); }
774 
775 #if OPERATING_SYSTEM == WINDOWS
776 
782 #endif
783 
785  void SetWidth(float newwidth);
786 
788  float GetWidth();
789 
794  void SetHeight(float newheight);
795 
797  float GetHeight();
798 
805  void SetClientWidth(float newwidth);
806 
813  float GetClientWidth();
814 
821  void SetClientHeight(float newheight);
822 
829  float GetClientHeight();
830 
838  void SetTitle(FCString* pTitle);
839 
846  void GetTitle(FCString* pTitle);
847 
857  bool QueryLastCommandModifierKeys(FLAG_32 modifiers)
858  {
859  return ((_lastcommandmodifierkeys & modifiers) == modifiers);
860  }
861 
866  virtual void CloseWindow() = 0;
867 
874  {
875  if (!CanClose()) return false;
876  CloseWindow();
877  return true;
878  }
879 
880 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
881 #if OPERATING_SYSTEM == MAC_OS
882 
883  _FCWindowController_cocoa* _GetCocoaLink()
884  {
885  return _pCocoaLink;
886  }
887 
888 #else
889 
891  void _SetWindowHandle(EWND hwnd) {
892  _hwnd = hwnd;
893  }
894 
895  EWND GetWindowHandle() { return _hwnd; }
896 #endif
897 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
898 
902  void SetMaximumResizeWidth(int width)
903  {
904  _maximumresizewidth = width;
905 #if OPERATING_SYSTEM == MAC_OS
906  /* On Cocoa, use the built-in maxsize */
907  _FCWindowController_cocoa* pCocoaLink = _GetCocoaLink();
908  if (!pCocoaLink) return;
909  pCocoaLink->SetMaximumResizeWidth(width);
910 #endif
911  }
912 
916  void SetMaximumResizeHeight(int height)
917  {
918  _maximumresizeheight = height;
919 #if OPERATING_SYSTEM == MAC_OS
920  /* On Cocoa, use the built-in maxsize */
921  _FCWindowController_cocoa* pCocoaLink = _GetCocoaLink();
922  if (!pCocoaLink) return;
923  pCocoaLink->SetMaximumResizeHeight(height);
924 #endif
925  }
926 
929  {
930  return _minimumresizewidth;
931  }
932 
935  {
936  if (_isinwindowshademode) return 0;
937  return _minimumresizeheight;
938  }
939 
942  {
943  return _maximumresizewidth;
944  }
945 
948  {
949  return _maximumresizeheight;
950  }
951 
958  bool WindowExists();
959 
961  void Hide();
962 
964  void ShowAndActivate();
965 
972  virtual void InitWindow();
973 
983  virtual void CloseButtonPressed()
984  {
985  _SetModalResult(0);
986  if (!_GetCloseWindowCalled()) TryToCloseWindow();
987  }
988 
998  virtual void OkButtonPressed()
999  {
1000  _SetModalResult(IDOK);
1001  if (!_GetCloseWindowCalled()) TryToCloseWindow();
1002  }
1003 
1013  virtual void CancelButtonPressed()
1014  {
1015  _SetModalResult(IDCANCEL);
1016  if (!_GetCloseWindowCalled()) TryToCloseWindow();
1017  }
1018 
1024  virtual bool HandleCommand(FCControl* pControl) { return false; }
1025 
1032  virtual void HandleSwitcherSelect(FCCtrlSwitcher* pControl, int switchindex);
1033 
1042  virtual void HandleUpDownPressed(FCControl* pControl, int delta) {}
1043 
1051  virtual void HandleDataListSelect(FCCtrlDataList* pControl, int lineindex) {}
1052 
1062  virtual void HandleDataListCheck(FCCtrlDataList* pControl, int lineindex, bool checkstate) {}
1063 
1065  virtual void HandleTimer(twobyte timerID) {}
1066 
1068  virtual void HandleActivate(bool activated) {}
1069 
1074  virtual void HandleResize(int newwidth, int newheight, int oldwidth, int oldheight) {}
1075 
1080  FCControl* FindControl(int controlid);
1081 
1094  void SetTimer(twobyte timerID, ufourbyte msInterval);
1095 
1101  void StopTimer(twobyte timerID);
1102 
1107  void Activate();
1108 
1113  virtual bool CanClose() { return true; }
1114 
1116  bool IsVisible();
1117 
1122  void StorePosition(bool storesize);
1123 
1129  bool RestorePosition();
1130 
1132  void SetRestorePositionData(float x, float y, float width, float height);
1133 
1135  void SetRestorePositionOnlyData(float x, float y);
1136 
1138  float GetStoredX();
1139 
1141  float GetStoredY();
1142 
1144  float GetStoredWidth();
1145 
1147  float GetStoredHeight();
1148 
1150  bool IsWindowshade() { return _isinwindowshademode; }
1151 
1157  void Windowshade(bool windowshade);
1158 
1163  void SetWindowAlpha(twobyte alphapercent);
1164 
1173 
1176  bool EndBufferControlMovement();
1177 
1183  bool IsInBufferMode() { return _bufferedcontrolmovement; }
1184 
1185 #if OPERATING_SYSTEM == WINDOWS
1186 
1187  void _WinSetInitWindowCalled(bool value)
1188  {
1189  _initwindowcalled = value;
1190  }
1191 
1194  {
1195  _restorepositioncalled = value;
1196  }
1197 
1201  {
1202  if (!_initwindowcalled) return;
1203  if (!_restorepositioncalled) return;
1204  RestorePosition();
1205  }
1206 #endif
1207 };
1208 
1209 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
1210 
1215 struct __FCControl_NONWINDOWSTORAGE
1216 {
1217  _NONWINDOW_PROPERTY_FCSTRING text;
1218  _NONWINDOW_PROPERTY_BOOL enabled;
1219  _NONWINDOW_PROPERTY_BOOL visible;
1220  _NONWINDOW_PROPERTY_FLOAT left;
1221  _NONWINDOW_PROPERTY_FLOAT top;
1222  _NONWINDOW_PROPERTY_FLOAT width;
1223  _NONWINDOW_PROPERTY_FLOAT height;
1224 };
1225 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
1226 
1227 
1237 class FCControl : public __FCBase
1238 {
1239 protected:
1240 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
1241 #if OPERATING_SYSTEM == WINDOWS
1242  HFONT _storednewfont; /* If the control has a custom font */
1243 
1245  float _WinHorizPixelsToPoints(float value);
1246 
1248  float _WinVertPixelsToPoints(float value);
1249 
1251  float _WinHorizPointsToPixels(float value);
1252 
1254  float _WinVertPointsToPixels(float value);
1255 #endif
1256 #endif
1257 public:
1263  ACTION_NONE = 0,
1264  ACTION_OK = 1,
1265  ACTION_CLOSE = 2,
1266  ACTION_CANCEL = 3
1267  };
1268 
1269 protected:
1270 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
1271  /* States for when the control handle isn't available: */
1272  __FCControl_NONWINDOWSTORAGE nonwindow_store;
1273 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
1274 private:
1275  bool _pointsmeasurement; /* If true, all measurements and positioning is in points. If false,
1276  measurement is system native. */
1277  bool _programmaticallycreate; /* True - create the control in code. False - control is available in resource. */
1278 
1279  bool _bufferedmove, _bufferedresize;
1280  float _bufferedx, _bufferedy, _bufferedwidth, _bufferedheight;
1281  twobyte _id;
1282  __FCUserWindow *_pParent;
1283 
1284  CONTROL_ACTIONS _controlaction;
1285 
1286 public:
1287 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
1288 
1289  enum _CONTROL_TYPE
1290  {
1291  CONTROLTYPE_UNDEFINED,
1292  CONTROLTYPE_UPDOWN,
1293  CONTROLTYPE_DATALIST,
1294  CONTROLTYPE_TREE,
1295  CONTROLTYPE_BUTTON,
1296  CONTROLTYPE_CHECKBOX,
1297  CONTROLTYPE_EDIT,
1298  CONTROLTYPE_STATIC,
1299  CONTROLTYPE_POPUP,
1300  CONTROLTYPE_COMBOBOX,
1301  CONTROLTYPE_LINE,
1302  CONTROLTYPE_SLIDER,
1303  CONTROLTYPE_LISTBOX,
1304  CONTROLTYPE_RADIOBUTTONGROUP,
1305  CONTROLTYPE_SWITCHER,
1306  CONTROLTYPE_CANVAS
1307  };
1308 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
1309 
1310  virtual const char* ClassName() { return "FCControl"; }
1311 
1318  FCControl(twobyte id) : __FCBase()
1319  {
1320  WINCODE(_storednewfont = 0;)
1321 
1322  _pointsmeasurement = false;
1323  _programmaticallycreate = false; /* Default toe resource-loaded control. */
1324  _id = id;
1325  _controlaction = ACTION_NONE;
1326  _pParent = NULL;
1327  _ResetBufferedMovement();
1328  }
1329 
1331  virtual ~FCControl()
1332  {
1333  WINCODE(DeleteObject(_storednewfont);)
1334  }
1335 
1340  bool GetPointsMeasurement() { return _pointsmeasurement; }
1341 
1342 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
1343 
1344  void _SetPointsMeasurement(bool use_points) { _pointsmeasurement = use_points; }
1345 
1347  virtual _CONTROL_TYPE _GetControlType() { return CONTROLTYPE_UNDEFINED; }
1348 
1353  virtual float _GetAutoCreateWidth() { return 70; }
1354 
1359  virtual float _GetAutoCreateMultilineHeight() { return 150; }
1360 
1361 #if OPERATING_SYSTEM == WINDOWS
1362  /* For internal use only!
1363  *
1364  * Creates controls on Windows.
1365  */
1366  bool _WinCreateUIControl(int height_DU, LPCSTR classnameA, LPWSTR classnameW, DWORD style, DWORD exstyle);
1367 #endif
1368 
1373  bool _CreateUIControl();
1374 
1381  virtual void _InitNonWindowHandleStates();
1382 
1389  virtual void _StoreNonWindowHandleStates();
1390 
1392  void SetParent(__FCUserWindow* parentptr)
1393  {
1394  _pParent = parentptr;
1395  }
1396 
1401  void _SetProgrammaticallyCreate(bool state) { _programmaticallycreate = state; }
1402 
1404  bool _GetProgrammaticallyCreate() { return _programmaticallycreate; }
1405 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
1406 
1408  __FCUserWindow* GetParent() { return _pParent; }
1409 
1413  {
1414  if (!_pParent) return false;
1415 #if OPERATING_SYSTEM == WINDOWS
1416  if (_GetWinControlHandle() == 0) return false;
1417 #else
1418  if (!_GetCocoaLink()) return false;
1419 #endif
1420  return _pParent->WindowExists();
1421  }
1422 
1423 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
1424 #if OPERATING_SYSTEM == MAC_OS
1425  /* For internal use. Gets the parent's link to the Cocoa interface. This might be NULL. */
1426  _FCWindowController_cocoa* _GetCocoaLink()
1427  {
1428  return _pParent ? _pParent->_GetCocoaLink() : NULL;
1429  }
1430 #else
1431 
1432  HWND GetWindowHandle() { return _pParent ? _pParent->GetWindowHandle() : 0; }
1433 #endif
1434 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
1435 
1436 #if OPERATING_SYSTEM == WINDOWS
1437 
1440  {
1441  if (!GetWindowHandle()) return 0;
1442  return GetDlgItem(GetWindowHandle(), GetControlID());
1443  }
1444 #endif
1445 
1450  virtual void Repaint()
1451  {
1452 #if OPERATING_SYSTEM == WINDOWS
1453  InvalidateRect(_GetWinControlHandle(), NULL, false);
1454 #endif
1455  }
1456 
1468  {
1469  return _id;
1470  }
1471 
1477  int GetAssignedID() { return _id; }
1478 
1483  CONTROL_ACTIONS GetAction() { return _controlaction; }
1484 
1489  void SetAction(CONTROL_ACTIONS action) { _controlaction = action; }
1490 
1498  virtual void SetEnable(bool state);
1499 
1507  virtual bool GetEnable();
1508 
1513  virtual void SetVisible(bool bShow);
1514 
1516  virtual void SetBold(bool state);
1517 
1522  virtual void SetKeyboardFocus();
1523 
1524 #if OPERATING_SYSTEM == MAC_OS
1525 
1526  void SetTextAndResize(FCString* pString);
1527 #endif
1528 
1534  virtual void SetText(FCString* pString);
1535 
1537  virtual void GetText(FCString* pString);
1538 
1540  void SetLeft(float pos);
1541 
1543  float GetLeft();
1544 
1546  void SetTop(float pos);
1547 
1549  float GetTop();
1550 
1552  float GetHeight();
1553 
1555  float GetWidth();
1556 
1558  bool GetVisible();
1559 
1561  void SetWidth(float width);
1562 
1564  void SetHeight(float height);
1565 
1571  void MoveRelative(float horizmove, float vertmove);
1572 
1578  void MoveAbsolute(float x, float y);
1579 
1586  virtual void ResizeRelative(float horizresize, float vertresize);
1587 
1588 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
1589 
1593  bool _HasBufferedMovement()
1594  {
1595  return (_bufferedmove || _bufferedresize);
1596  }
1597 
1599  void _ResetBufferedMovement()
1600  {
1601  _bufferedmove = _bufferedresize = false;
1602  }
1603 
1605  void _GetBufferedMovement(bool *pshouldmove, bool *pshouldresize,
1606  float *px, float *py, float *pwidth, float *pheight)
1607  {
1608  *pshouldmove = _bufferedmove;
1609  *pshouldresize = _bufferedresize;
1610  *px = _bufferedx;
1611  *py = _bufferedy;
1612  *pwidth = _bufferedwidth;
1613  *pheight = _bufferedheight;
1614  }
1615 
1620  void _BufferMove(float x, float y)
1621  {
1622  _bufferedmove = true;
1623  _bufferedx = x;
1624  _bufferedy = y;
1625  }
1626 
1631  void _BufferResize(float width, float height)
1632  {
1633  _bufferedresize = true;
1634  _bufferedwidth = width;
1635  _bufferedheight = height;
1636  }
1637 
1638 #ifdef PDK_FRAMEWORK_DIAGNOSE
1639 
1643  bool _ControlExists();
1644 
1648  void _ControlClassCheck();
1649 
1656  virtual const char* _WinGetUIClassName() { return "Undefined"; }
1657 
1665  virtual const char* _MacGetUIClassName() { return "Undefined"; }
1666 
1667 #endif /* PDK_FRAMEWORK_DIAGNOSE */
1668 
1669 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
1670 };
1671 
1672 class FCCtrlEdit;
1673 
1681 class FCCtrlUpDown : public FCControl
1682 {
1683  struct __FCCtrlUpDown_NONWINDOWSTORAGE
1684  {
1685  _NONWINDOW_PROPERTY_INT steppervalue;
1686  _NONWINDOW_PROPERTY_INT min;
1687  _NONWINDOW_PROPERTY_INT max;
1688  } updown_nonwindow_store;
1689 
1690  /* For internal use only! */
1691  virtual void _InitNonWindowHandleStates();
1692 
1693  /* For internal use only */
1694  virtual void _StoreNonWindowHandleStates();
1695 
1696  enum {
1697  CONNECTED_NONE,
1698  CONNECTED_INT,
1699  CONNECTED_MEASUREMENT
1700  } _connectededitmode;
1701 
1702  FCCtrlEdit* _pConnectedEditControl;
1703  int _minInt;
1704  int _maxInt;
1705  double _minMeasurement;
1706  double _maxMeasurement;
1707  int _value;
1708 public:
1710  FCCtrlUpDown(twobyte id) : FCControl(id)
1711  {
1712  _connectededitmode = CONNECTED_NONE;
1713  _pConnectedEditControl = NULL;
1714  _minInt = _maxInt = 0;
1715  _minMeasurement = _maxMeasurement = 0;
1716  _value = 0;
1717  }
1718 
1719  virtual const char* ClassName() { return "FCCtrlUpDown"; }
1720 
1726  void SetValue(int value);
1727 
1732  int GetValue();
1733 
1738  void SetRange(int min, int max);
1739 
1744  int GetMinimum();
1745 
1750  int GetMaximum();
1751 
1756  FCCtrlEdit* GetConnectedEdit() { return _pConnectedEditControl; }
1757 
1758 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
1759  virtual _CONTROL_TYPE _GetControlType() { return CONTROLTYPE_UPDOWN; }
1760 
1761  virtual float _GetAutoCreateWidth() { return WINCODE(14;) MACCODE(19;) }
1762 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
1763 
1776  bool ConnectIntegerEdit(FCCtrlEdit* pControl, int min, int max)
1777  {
1778  if (!pControl) return false;
1779  if (max < min) return false;
1780  _connectededitmode = CONNECTED_INT;
1781  _pConnectedEditControl = pControl;
1782  _minInt = min;
1783  _maxInt = max;
1784 #if OPERATING_SYSTEM == MAC_OS
1785  SetRange(min, max);
1786 #endif
1787  return true;
1788  }
1789 
1802  bool ConnectMeasurementEdit(FCCtrlEdit* pControl, double min, double max)
1803  {
1804  if (!pControl) return false;
1805  if (max < min) return false;
1806  _connectededitmode = CONNECTED_MEASUREMENT;
1807  _pConnectedEditControl = pControl;
1808  _minMeasurement = min;
1809  _maxMeasurement = max;
1810 #if OPERATING_SYSTEM == MAC_OS
1811  SetRange((int) min, (int) max);
1812 #endif
1813  return true;
1814  }
1815 
1816 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
1817 
1818  void _HandleConnectedEditEvent(int delta);
1819 #endif
1820 
1821 #ifdef PDK_FRAMEWORK_DIAGNOSE
1822  virtual const char* _WinGetUIClassName() { return "msctls_updown32"; }
1823  virtual const char* _MacGetUIClassName() { return "NSStepper"; }
1824 #endif
1825 };
1826 
1836 class FCCtrlLine : public FCControl
1837 {
1838 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
1839  virtual _CONTROL_TYPE _GetControlType() { return CONTROLTYPE_LINE; }
1840 
1841  virtual float _GetAutoCreateWidth() { return 150; }
1842 
1843 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
1844 
1845  bool _horizontal; /* Only for programmatically created controls. */
1846 public:
1847  virtual const char* ClassName() { return "FCCtrlLine"; }
1848 
1850  FCCtrlLine(twobyte id) : FCControl(id)
1851  {
1852  _horizontal = true;
1853  }
1854 
1855  virtual void SetEnable(bool state)
1856  {
1857 #if OPERATING_SYSTEM == WINDOWS
1858  FCControl::SetEnable(state);
1859 #endif
1860  }
1861 
1862  virtual bool GetEnable()
1863  {
1864 #if OPERATING_SYSTEM == WINDOWS
1865  return FCControl::GetEnable();
1866 #endif
1867  return true;
1868  }
1869 
1875  void SetHorizontal(bool horiz) { _horizontal = horiz; }
1876 
1881  bool GetHorizontal() { return _horizontal; }
1882 
1883 #ifdef PDK_FRAMEWORK_DIAGNOSE
1884  virtual const char* _WinGetUIClassName() { return "Static"; }
1885  virtual const char* _MacGetUIClassName() { return "NSBox"; }
1886 #endif
1887 };
1888 
1893 class FCCtrlStatic : public FCControl
1894 {
1895 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
1896  virtual _CONTROL_TYPE _GetControlType() { return CONTROLTYPE_STATIC; }
1897 
1898  virtual float _GetAutoCreateWidth() { return 100; }
1899 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
1900 public:
1901  virtual const char* ClassName() { return "FCCtrlStatic"; }
1902 
1904  FCCtrlStatic(twobyte id) : FCControl(id) {}
1905 
1907  void Clear();
1908 
1910  void SetInteger(int anint);
1911 
1912 #ifdef PDK_FRAMEWORK_DIAGNOSE
1913  virtual const char* _WinGetUIClassName() { return "Static"; }
1914  virtual const char* _MacGetUIClassName() { return "NSTextField"; }
1915 #endif
1916 };
1917 
1924 class FCCtrlEdit : public FCControl
1925 {
1926 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
1927  virtual _CONTROL_TYPE _GetControlType() { return CONTROLTYPE_EDIT; }
1928 
1929  virtual float _GetAutoCreateWidth() { return 70; }
1930 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
1931 public:
1932  virtual const char* ClassName() { return "FCCtrlEdit"; }
1933 
1935  FCCtrlEdit(twobyte id) : FCControl(id) {
1936  }
1937 
1942  int GetInteger();
1943 
1954  int GetRangeInteger(int minimum, int maximum);
1955 
1956 #ifdef PDK_FRAMEWORK_PREFS
1957 
1967  double GetMeasurement(_ENUMCODE(MEASUREMENTUNITS) _LUACODE(twobyte) measurementunit);
1968 
1984  double GetRangeMeasurement(_ENUMCODE(MEASUREMENTUNITS) _LUACODE(twobyte) measurementunit, double min, double max);
1985 
1997  float GetMeasurementEfix(_ENUMCODE(MEASUREMENTUNITS) _LUACODE(twobyte) measurementunit)
1998  {
1999  /* Since this method calls GetMeasurement(), it supports controls without window handles. */
2000  float f = GetMeasurement(measurementunit);
2001  f *= 64;
2002  return f;
2003  }
2004 
2005 
2021  float GetRangeMeasurementEfix(_ENUMCODE(MEASUREMENTUNITS) _LUACODE(twobyte) measurementunit, float min, float max)
2022  {
2023  /* Since this method ultimately calls GetMeasurement(), it supports controls without window handles. */
2024  float f = GetRangeMeasurement(measurementunit, min / 64, max / 64);
2025  f *= 64;
2026  return f;
2027  }
2028 
2043  void SetMeasurement(double value, _ENUMCODE(MEASUREMENTUNITS) _LUACODE(twobyte) measurementunit);
2044 
2057  void SetMeasurementEfix(float value, _ENUMCODE(MEASUREMENTUNITS) _LUACODE(twobyte) measurementunit)
2058  {
2059  value /= 64;
2060  SetMeasurement(value, measurementunit);
2061  }
2062 
2074  double GetMeasurementInteger(_ENUMCODE(MEASUREMENTUNITS) _LUACODE(twobyte) measurementunit);
2075 
2091  double GetRangeMeasurementInteger(_ENUMCODE(MEASUREMENTUNITS) _LUACODE(twobyte) measurementunit, int min, int max);
2092 
2104  void SetMeasurementInteger(double value, _ENUMCODE(MEASUREMENTUNITS) _LUACODE(twobyte) measurementunit);
2105 #endif
2106 
2111  void SetInteger(int anint);
2112 
2114  void SetFloat(float value);
2115 
2117  float GetFloat(float min, float max);
2118 
2120  void AdjustIntegerWithin(int min, int max);
2121 
2123  void SetFocus();
2124 
2126  void SelectAll();
2127 
2129  void SetMaxLength(twobyte maxlength);
2130 
2132  void SetReadOnly(bool readonly);
2133 
2135  void ScrollToBottom();
2136 
2137 #ifdef PDK_FRAMEWORK_DIAGNOSE
2138  virtual const char* _WinGetUIClassName() { return "Edit"; }
2139  virtual const char* _MacGetUIClassName() { return "NSTextField;NSSearchField"; }
2140 #endif
2141 };
2142 
2149 class FCCtrlPopup : public FCControl
2150 {
2151  virtual _CONTROL_TYPE _GetControlType() { return CONTROLTYPE_POPUP; }
2152 
2153  virtual float _GetAutoCreateWidth() { return 100; }
2154 
2155  struct __FCCtrlPopup_NONWINDOWSTORAGE
2156  {
2157  _NONWINDOW_PROPERTY_INT selecteditem;
2158  _NONWINDOW_PROPERTY_FCSTRINGS items;
2159  } popup_nonwindow_store;
2160 
2161  /* For internal use only! */
2162  virtual void _InitNonWindowHandleStates();
2163 
2164  /* For internal use only */
2165  virtual void _StoreNonWindowHandleStates();
2166 public:
2167  virtual const char* ClassName() { return "FCCtrlPopup"; }
2168 
2170  FCCtrlPopup(twobyte id) : FCControl(id) {}
2171 
2176  void Clear();
2177 
2182  void AddString(FCString* pString);
2183 
2185  void InsertString(int index, FCString* pString);
2186 
2196  void SetStrings(FCStrings* pStrings)
2197  {
2198  Clear();
2199  if (!pStrings) return;
2200  for (int i = 0; i < pStrings->GetCount(); i++)
2201  {
2202  FCString* pString = pStrings->GetItemAt(i);
2203  AddString(pString);
2204  }
2205  }
2206 
2213  void DeleteItem(int index);
2214 
2219  int GetCount();
2220 
2227  int GetSelectedItem();
2228 
2235  void SetSelectedItem(int index);
2236 
2238  void SetItemText(int index, FCString* pString);
2239 
2240 #ifdef PDK_FRAMEWORK_DIAGNOSE
2241  virtual const char* _WinGetUIClassName() { return "ComboBox"; }
2242  virtual const char* _MacGetUIClassName() { return "NSPopUpButton"; }
2243 #endif
2244 };
2245 
2246 
2255 {
2256  virtual _CONTROL_TYPE _GetControlType() { return CONTROLTYPE_COMBOBOX; }
2257 public:
2258  virtual const char* ClassName() { return "FCCtrlComboBox"; }
2259 
2261  FCCtrlComboBox(twobyte id) : FCCtrlEdit(id) {}
2262 
2266  void Clear();
2267 
2270  void AddString(FCString* pString);
2271 
2279  void SetStrings(FCStrings* pStrings)
2280  {
2281  Clear();
2282  if (!pStrings) return;
2283  for (int i = 0; i < pStrings->GetCount(); i++)
2284  {
2285  FCString* pString = pStrings->GetItemAt(i);
2286  AddString(pString);
2287  }
2288  }
2289 
2293  int GetCount();
2294 
2295 #ifdef PDK_FRAMEWORK_DIAGNOSE
2296  virtual const char* _WinGetUIClassName() { return "ComboBox"; }
2297  virtual const char* _MacGetUIClassName() { return "NSComboBox"; }
2298 #endif
2299 };
2300 
2301 class FCCtrlDataList;
2302 
2310 class FCDataListRow : public FCStrings
2311 {
2312  bool _checked;
2313  int _connectedlineindex;
2314  FCCtrlDataList* _connectedlist;
2315 public:
2316 
2317 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
2318 
2320  void _MakeConnection(FCCtrlDataList* pCtrl, int lineindex);
2321 
2324  void _SetCheckState(bool state) { _checked = state; }
2325 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
2326 
2329  {
2330  _checked = false;
2331  _connectedlineindex = -1;
2332  _connectedlist = NULL;
2333  }
2334 
2336  void SetCheck(bool state);
2337 
2339  bool GetCheck() { return _checked; }
2340 
2342  int GetConnectedLineIndex() { return _connectedlineindex; }
2343 
2345  FCCtrlDataList* GetConnectedList() { return _connectedlist; }
2346 };
2347 
2358 {
2359  bool _usecheckboxes; /* Used for programmatically-created dialog boxes only. */
2360 
2361  struct __FCDataList_NONWINDOWSTORAGE
2362  {
2363  _NONWINDOW_PROPERTY_FCSTRINGS columntexts;
2364  _NONWINDOW_PROPERTY_FCNUMBERS columnwidths;
2365  _NONWINDOW_PROPERTY_INT selectedindex;
2366  } datalist_nonwindow_store;
2367 
2368  __FCCollection _rows; /* The collection of pointer references to the
2369  * rows, so they can be deleted when the lines
2370  * are deleted. */
2371 
2372  /* For internal use only! */
2373  virtual void _InitNonWindowHandleStates();
2374 
2375  /* For internal use only */
2376  virtual void _StoreNonWindowHandleStates();
2377 
2378  /* Builds the list */
2379  void _BuildList();
2380 public:
2381 
2382 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
2383 
2384 #if OPERATING_SYSTEM == MAC_OS
2385  int _fontsize;
2386 #endif
2387 
2388  virtual _CONTROL_TYPE _GetControlType() { return CONTROLTYPE_DATALIST; }
2389 
2390  virtual float _GetAutoCreateWidth() { return 200; }
2391 
2392  virtual float _GetAutoCreateMultilineHeight() { return 150; }
2393 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
2394 
2395  virtual const char* ClassName() { return "FCCtrlDataList"; }
2396 
2398  FCCtrlDataList(twobyte id) : FCControl(id)
2399  {
2400  _usecheckboxes = false;
2401  datalist_nonwindow_store.selectedindex.value = -1;
2402 #if OPERATING_SYSTEM == MAC_OS
2403  _fontsize = 12;
2404 #endif
2405  }
2406 
2407  virtual ~FCCtrlDataList()
2408  {
2409  //_rows.ClearAll();
2410  }
2411 
2416  void SetFontSize(int fontsize)
2417  {
2418 #if OPERATING_SYSTEM == MAC_OS
2419  _fontsize = fontsize;
2420 #endif
2421  }
2422 
2423 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
2424  const eUniChar16* _GetCellUnicodeText(FCDataListRow* pRow, int columnindex);
2425 
2426  const char* _GetCellCText(FCDataListRow* pRow, int columnindex);
2427 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
2428 
2434  void SetColumnTitle(int columnindex, FCString* pTitle);
2435 
2440  bool AddColumn(FCString* pTitle, float columnwidth);
2441 
2449  int AddRow(FCDataListRow* pRow);
2450 
2454  bool InsertRowAt(FCDataListRow* pRow, int);
2455 
2461  FCDataListRow* CreateRow();
2462 
2471  bool DeleteRow(int lineindex);
2472 
2477  void DeleteAll();
2478 
2480  void DeleteAllColumns();
2481 
2488  bool GetUseCheckboxes() const { return _usecheckboxes; }
2489 
2497  void SetUseCheckboxes(bool state) { _usecheckboxes = state; }
2498 
2506  bool UseLeftCheckboxColumn();
2507 
2514  void UseGrid();
2515 
2520  void UseFullRowSelect();
2521 
2526  int GetCount();
2527 
2532  FCDataListRow* GetItemAt(int lineindex);
2533 
2535  void Redraw();
2536 
2541  bool SelectLine(int lineindex, bool ensurevisible);
2542 
2544  void ScrollToTop();
2545 
2550  void ExpandLastColumn();
2551 
2561  int GetSelectedLine();
2562 
2575  virtual void HandleSelectChange(int lineindex) {}
2576 
2588  virtual void HandleUnselect() {}
2589 
2595  virtual void HandleCheckChange(int lineindex, bool state)
2596  {
2597  FCDataListRow* pRow = GetItemAt(lineindex);
2598  if (!pRow) return;
2599  pRow->_SetCheckState(state);
2600  }
2601 
2605  virtual void HandleDoubleClick() {}
2606 
2609  void ReconnectAll();
2610 
2613  bool HasCheckboxes();
2614 
2624  int GetDetailedColumnCount(bool includecheckboxcolumn);
2625 
2630  int GetColumnCount() { return GetDetailedColumnCount(false); }
2631 
2638  float GetColumnWidth(int columnindex);
2639 
2646  bool Swap(int rowindex1, int rowindex2, bool redraw);
2647 
2648 #ifdef PDK_FRAMEWORK_DIAGNOSE
2649  virtual const char* _WinGetUIClassName() { return "SysListView32"; }
2650  virtual const char* _MacGetUIClassName() { return "NSTableView"; }
2651 #endif
2652 };
2653 
2672 #if OPERATING_SYSTEM == WINDOWS
2673 class FCCtrlListBox : public FCControl
2674 #else
2675 class FCCtrlListBox : public FCCtrlDataList
2676 #endif
2677 {
2678 public:
2679 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
2680  virtual _CONTROL_TYPE _GetControlType() { return CONTROLTYPE_LISTBOX; }
2681 
2682  virtual float _GetAutoCreateWidth() { return 150; }
2683 
2684  virtual float _GetAutoCreateMultilineHeight() { return 170; }
2685 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
2686 private:
2687 
2688  struct __FCCtrlListBox_NONWINDOWSTORAGE
2689  {
2690  _NONWINDOW_PROPERTY_INT selecteditem;
2691  _NONWINDOW_PROPERTY_FCSTRINGS items;
2692  } listbox_nonwindow_store;
2693 
2694  /* For internal use only! */
2695  virtual void _InitNonWindowHandleStates();
2696 
2697  /* For internal use only */
2698  virtual void _StoreNonWindowHandleStates();
2699 
2700 #if OPERATING_SYSTEM == MAC_OS
2701  void _MacSetupListboxColumn();
2702 #endif
2703 public:
2704  virtual const char* ClassName() { return "FCCtrlListBox"; }
2705 
2707  FCCtrlListBox(twobyte id);
2708 
2713  void Clear();
2714 
2719  void AddString(FCString* pString);
2720 
2727  int GetSelectedItem();
2728 
2733  int GetCount();
2734 
2741  void SetSelectedItem(int index);
2742 
2750  {
2751  /* Both GetCount() and SetSelectedItem() has non-window support. */
2752  int count = GetCount();
2753  if (count < 1) return false;
2754  SetSelectedItem(count - 1);
2755  return true;
2756  }
2757 
2759  void ClearSelection();
2760 
2767  void SetItemText(int index, FCString* pString);
2768 
2775  void GetItemText(int index, FCString* pString);
2776 
2781  void DeleteItem(int index);
2782 
2791  void InsertItem(int index, FCString* pString);
2792 
2800  void SetStrings(FCStrings* pStrings);
2801 
2802 #ifdef PDK_FRAMEWORK_DIAGNOSE
2803  virtual const char* _WinGetUIClassName() { return "ListBox"; }
2804 #endif
2805 };
2806 
2807 
2808 class FCCtrlTree;
2809 
2817 {
2818 
2824 #if OPERATING_SYSTEM == WINDOWS
2825  /* Windows - a tree view item handle */
2826  HANDLE
2827 #else
2828  /* Cocoa - a NSValue that contains a pointer to the FCTreeNode */
2829  void*
2830 #endif
2831  _itemhandle;
2832 
2833  bool _isselected;
2834  bool _iscontainer;
2835  bool _expanded;
2836  FCString _thetext;
2837  FCCtrlTree* _pTreeControl;
2838  FCTreeNode* _pParentNode;
2839 
2841  void UpdateText();
2842  public:
2847  FCTreeNode(FCString* pText);
2848 
2850  virtual ~FCTreeNode();
2851 
2858  FCTreeNode* GetItemAt(int index) { return (FCTreeNode*) __FCCollection::GetItemAt(index); }
2859 
2868  void SetText(FCString* pText) {
2869  if (pText)
2870  _thetext.SetString(pText);
2871  else
2872  _thetext.Clear();
2873 
2874  UpdateText();
2875  }
2876 
2883  void GetText(FCString* pString)
2884  {
2885  if (!pString) return;
2886  pString->SetString(&_thetext);
2887  }
2888 
2891  {
2892  return &_thetext;
2893  }
2894 
2895 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
2896 
2898  void _SetIsContainer(bool state) { _iscontainer = state; }
2899 
2905  void _SetExpanded(bool state) { _expanded = state; }
2906 
2912  bool _GetExpanded() { return _expanded; }
2913 #endif
2914 
2922  bool GetIsContainer() { return _iscontainer; }
2923 
2924 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
2925  void _SetTreeControl(FCCtrlTree* pTree) { _pTreeControl = pTree; }
2926 
2927  FCCtrlTree* _GetTreeControl() { return _pTreeControl; }
2928 
2929  void _SetParentNode(FCTreeNode* pNode) { _pParentNode = pNode; }
2930 
2931  /* Only used when creating a tree view programmatically before the window displays... */
2932  void _SetSelected(bool selected) { _isselected = selected; }
2933 
2934  /* Only used when creating a tree view programmatically before the window displays... */
2935  bool _GetSelected() { return _isselected; }
2936 #endif
2937 
2944  FCTreeNode* GetParentNode() { return _pParentNode; }
2945 
2952  int GetIndex()
2953  {
2954  if (!_pParentNode) return -1;
2955  return _pParentNode->GetIndexOf(this);
2956  }
2957 
2965  {
2966  if (!_pParentNode) return 0;
2967  return _pParentNode->GetCount();
2968  }
2969 
2971 #if OPERATING_SYSTEM == WINDOWS
2972  /* Windows - a tree view item handle */
2973  HANDLE
2974 #else
2975  /* Cocoa - a NSValue that contains a pointer to the FCTreeNode */
2976  void*
2977 #endif
2978  _GetItemHandle() { return _itemhandle; }
2979 
2981  void _SetItemHandle(
2982 #if OPERATING_SYSTEM == WINDOWS
2983  /* Windows - a tree view item handle */
2984  HANDLE
2985 #else
2986  /* Cocoa */
2987  void*
2988 #endif
2989  item);
2990 
2991 #ifdef PDK_FRAMEWORK_DEBUG
2992  virtual void DebugDump()
2993  {
2994  DebugOutBool("Is Container: ", _iscontainer);
2995  FCString astring;
2996  GetText(&astring);
2997  DebugOutString("Text: ", &astring);
2998  }
2999 
3000 #endif
3001 };
3002 
3003 
3020 class FCCtrlTree : public FCControl
3021 {
3022  /*
3023  IMPLEMENTATION INFO:
3024  Since the tree is mirrored in internal data already, there's no need to use additional storage for
3025  programmatically created controls. Instead, the existing data structure is used.
3026  */
3027 
3028 
3029 #if OPERATING_SYSTEM == MAC_OS
3030  void _MacSetupTreeColumn();
3031  int _fontsize;
3032 #endif
3033 
3034  FCTreeNode* _pRootNode;
3035 
3036  FCTreeNode* _MapItem(WINCODE(HANDLE) MACCODE(FCTreeNode*) htreeitem,
3037  FCTreeNode *pBaseNode = NULL);
3038 
3039  void _DeleteAllSubNodes(FCTreeNode* pBaseNode);
3040  public:
3041 
3043  /* Windows constructor */
3044  FCCtrlTree(twobyte id) : FCControl(id)
3045  {
3046 #if OPERATING_SYSTEM == MAC_OS
3047  _fontsize = 12;
3048 #endif
3049  _pRootNode = new FCTreeNode(NULL);
3050  }
3051 
3052  virtual ~FCCtrlTree()
3053  {
3054  _DeleteAllSubNodes(_pRootNode);
3055  delete _pRootNode;
3056  }
3057 
3058 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
3059  virtual _CONTROL_TYPE _GetControlType() { return CONTROLTYPE_TREE; }
3060 
3061  virtual float _GetAutoCreateWidth() { return 150; }
3062 
3063  virtual float _GetAutoCreateMultilineHeight() { return 170; }
3064 
3065  /* For internal use only! */
3066  virtual void _InitNonWindowHandleStates();
3067 
3068  /* For internal use only */
3069  virtual void _StoreNonWindowHandleStates();
3070 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
3071 
3072  virtual const char* ClassName() { return "FCCtrlTree"; }
3073 
3074 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
3075 
3079  void _BuildTree();
3080 
3085  void _MarkSelectedNode(FCTreeNode* pNode);
3086 #endif
3087 
3108  FCTreeNode* AddNode(FCTreeNode *pParentNode, bool isContainer, FCString* pText);
3109 
3124  FCTreeNode* InsertNodeAt(FCTreeNode *pParentNode, FCString* pText, int index);
3125 
3131  bool DeleteNode(FCTreeNode *pNode);
3132 
3143  bool SwapNodes(FCTreeNode* pNode1, FCTreeNode* pNode2);
3144 
3149  void ExpandNode(FCTreeNode *pNode);
3150 
3157  void CollapseNode(FCTreeNode *pNode);
3158 
3170  bool IsNodeAttached(FCTreeNode *pNode2Find, FCTreeNode *pBaseNode);
3171 
3173  FCTreeNode* FindUserDataNode(void* userdata, FCTreeNode *pBaseNode);
3174 
3181  FCTreeNode* GetSelectedNode();
3182 
3191  int CalcRootIndex(FCTreeNode* pNode);
3192 
3203  int CalcNodeIndex(FCTreeNode* pNode, FCTreeNode* pParentNode);
3204 
3210  void SetFontSize(int size)
3211  {
3212 #if OPERATING_SYSTEM == MAC_OS
3213  _fontsize = size;
3214 #endif
3215  }
3216 
3226  bool SetSelectedNode(FCTreeNode* pNode);
3227 
3232  void Clear();
3233 
3238  void ExpandAllContainers();
3239 
3244  void CollapseAllContainers();
3245 
3252  int GetRootCount() { return _pRootNode->GetCount(); }
3253 
3263  {
3264  return (FCTreeNode*) _pRootNode->GetItemAt(index);
3265  }
3266 
3267 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
3268 
3269  FCTreeNode* _GetRootNode()
3270  {
3271  return _pRootNode;
3272  }
3273 #endif
3274 
3284  {
3285  return _pRootNode->GetIndexOf(pNode);
3286  }
3287 
3289  virtual void Repaint();
3290 
3291 #ifdef PDK_FRAMEWORK_DIAGNOSE
3292  virtual const char* _WinGetUIClassName() { return "SysTreeView32"; }
3293  virtual const char* _MacGetUIClassName() { return "NSOutlineView"; }
3294 #endif
3295 };
3296 
3311 {
3312  __FCCollection _pagecontrolids; /* Collection of FCNumbers objects.
3313  The number of collections should be identical
3314  to the number of pages. */
3315 
3316  struct __FCCtrlSwitcher_NONWINDOWSTORAGE
3317  {
3318  _NONWINDOW_PROPERTY_INT selectedindex;
3319  _NONWINDOW_PROPERTY_FCSTRINGS items;
3320  } switcher_nonwindow_store;
3321 
3322 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
3323  virtual float _GetAutoCreateWidth() { return 200; }
3324 
3325  /* For internal use only! */
3326  virtual void _InitNonWindowHandleStates();
3327 
3328  /* For internal use only */
3329  virtual void _StoreNonWindowHandleStates();
3330 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
3331 
3332  bool _FindControlIDReference(int theid);
3333  public:
3335  FCCtrlSwitcher(twobyte id) : FCControl(id) {}
3336 
3337 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
3338  virtual _CONTROL_TYPE _GetControlType() { return CONTROLTYPE_SWITCHER; }
3339 #endif
3340 
3347  void AddPage(FCString* pString);
3348 
3360  bool AttachControl(FCControl* pControl, int index);
3361 
3367  void HandleVisibleStates(int index);
3368 
3373  int GetPageCount();
3374 
3380  int GetSelectedPage();
3381 
3388  void SetSelectedPage(int index);
3389 
3390 #ifdef PDK_FRAMEWORK_DIAGNOSE
3391  virtual const char* _WinGetUIClassName() { return "SysTabControl32"; }
3392  virtual const char* _MacGetUIClassName() { return "NSSegmentedControl"; }
3393 #endif
3394 };
3395 
3396 //---------------------------------------------------------------------------
3397 
3405 {
3406  struct __FCCtrlCheckbox_NONWINDOWSTORAGE
3407  {
3408  _NONWINDOW_PROPERTY_BOOL checkstate;
3409  } radiobutton_nonwindow_store;
3410 
3411  virtual float _GetAutoCreateWidth() { return 100; }
3412 
3413  /* For internal use only! */
3414  virtual void _InitNonWindowHandleStates();
3415 
3416  /* For internal use only */
3417  virtual void _StoreNonWindowHandleStates();
3418 public:
3419 
3421  FCCtrlRadioButton(twobyte id) : FCControl(id) {}
3422 
3428  void SetCheck(bool checked);
3429 
3431  bool GetCheck();
3432 
3433 #ifdef PDK_FRAMEWORK_DIAGNOSE
3434  virtual const char* _WinGetUIClassName() { return "Button"; }
3435  virtual const char* _MacGetUIClassName() { return "NSButton"; }
3436 #endif
3437 };
3438 
3442 {
3443  virtual _CONTROL_TYPE _GetControlType() { return CONTROLTYPE_RADIOBUTTONGROUP; }
3444 public:
3446  FCCtrlRadioButtonGroup(twobyte id, int no_of_items) : FCControl(id)
3447  {
3448 
3449  }
3450 };
3451 
3459 {
3460  struct __FCCtrlCheckbox_NONWINDOWSTORAGE
3461  {
3462  _NONWINDOW_PROPERTY_INT checkstate;
3463  _NONWINDOW_PROPERTY_BOOL threestate;
3464  } checkbox_nonwindow_store;
3465 
3467  virtual _CONTROL_TYPE _GetControlType() { return CONTROLTYPE_CHECKBOX; }
3468 
3469  virtual float _GetAutoCreateWidth() { return 100; }
3470 
3471  /* For internal use only! */
3472  virtual void _InitNonWindowHandleStates();
3473 
3474  /* For internal use only */
3475  virtual void _StoreNonWindowHandleStates();
3476 public:
3478  FCCtrlCheckbox(twobyte id) : FCControl(id) {}
3479 
3486  virtual void SetCheck(twobyte checked);
3487 
3492  virtual twobyte GetCheck();
3493 
3506  void SetThreeStatesMode(bool allow3states)
3507  {
3508  checkbox_nonwindow_store.threestate.value = allow3states;
3509  }
3510 
3515  bool GetThreeStatesMode() const
3516  {
3517  return checkbox_nonwindow_store.threestate.value;
3518  }
3519 
3520 #ifdef PDK_FRAMEWORK_DIAGNOSE
3521  virtual const char* _WinGetUIClassName() { return "Button"; }
3522  virtual const char* _MacGetUIClassName() { return "NSButton"; }
3523 #endif
3524 };
3525 
3533 {
3534  WINCODE(HFONT _storednewfont;)
3535 
3537  virtual _CONTROL_TYPE _GetControlType() { return CONTROLTYPE_BUTTON; }
3538 
3539  virtual float _GetAutoCreateWidth() { return 60; }
3540 public:
3542  FCCtrlButton(twobyte id) : FCCtrlCheckbox(id)
3543  {
3544  WINCODE(_storednewfont = 0;)
3545  }
3546 
3547  /* Destructor */
3548  virtual ~FCCtrlButton();
3549 
3551  void ClearShortcutKey();
3552 
3561  void SetFontSize(int fontsize);
3562 
3563 #ifdef PDK_FRAMEWORK_DIAGNOSE
3564  virtual const char* _WinGetUIClassName() { return "Button"; }
3565  virtual const char* _MacGetUIClassName() { return "NSButton"; }
3566 #endif
3567 };
3568 
3569 
3576 class FCCtrlSlider : public FCControl
3577 {
3579  virtual _CONTROL_TYPE _GetControlType() { return CONTROLTYPE_SLIDER; }
3580 
3581  virtual float _GetAutoCreateWidth() { return 150; }
3582 
3583  struct __FCCtrlSlider_NONWINDOWSTORAGE
3584  {
3585  _NONWINDOW_PROPERTY_INT minvalue;
3586  _NONWINDOW_PROPERTY_INT maxvalue;
3587  _NONWINDOW_PROPERTY_INT thumbpos;
3588  } slider_nonwindow_store;
3589 
3590  /* For internal use only! */
3591  virtual void _InitNonWindowHandleStates();
3592 
3593  /* For internal use only */
3594  virtual void _StoreNonWindowHandleStates();
3595 public:
3597  FCCtrlSlider(twobyte id) : FCControl(id) {}
3598 
3603  int GetMinValue();
3604 
3609  void SetMinValue(int min);
3610 
3615  int GetMaxValue();
3616 
3621  void SetMaxValue(int max);
3622 
3627  void SetThumbPosition(int position);
3628 
3635  int GetThumbPosition();
3636 
3637 #ifdef PDK_FRAMEWORK_DIAGNOSE
3638  virtual const char* _WinGetUIClassName() { return "msctls_trackbar32"; }
3639  virtual const char* _MacGetUIClassName() { return "NSSlider"; }
3640 #endif
3641 };
3642 
3643 
3644 #ifdef PDK_FRAMEWORK_CANVASCTRL
3645 
3651 class FCCtrlCanvas : public FCControl
3652 {
3653  struct __FCCtrlSlider_NONWINDOWSTORAGE
3654  {
3655  _NONWINDOW_PROPERTY_VOIDPTR instructions;
3656  } canvas_nonwindow_store;
3657 
3659  virtual _CONTROL_TYPE _GetControlType() { return CONTROLTYPE_CANVAS; }
3660 
3661  virtual float _GetAutoCreateWidth() { return 80; }
3662 
3663  virtual float _GetAutoCreateMultilineHeight() { return 80; }
3664 
3665  /* For internal use only! */
3666  virtual void _InitNonWindowHandleStates();
3667 
3668  /* For internal use only */
3669  virtual void _StoreNonWindowHandleStates();
3670 public:
3672  FCCtrlCanvas(twobyte id) : FCControl(id) {}
3673 
3676  void RebuildInstructions(FCVirtualCanvasInstructions* pInstructions);
3677 
3678 #ifdef PDK_FRAMEWORK_DIAGNOSE
3679  virtual const char* _WinGetUIClassName() { return "Static"; }
3680  virtual const char* _MacGetUIClassName() { return "NSFCCtrlCanvas"; }
3681 #endif
3682 
3683 };
3684 #endif /* #ifdef PDK_FRAMEWORK_CANVASCTRL */
3685 
3692  int _resourceid;
3693 #if OPERATING_SYSTEM == WINDOWS
3694  FF_DialogHandlerUPP _handler;
3695 #endif
3696  __FCUserWindow* _pParent;
3697 
3698 public:
3699 
3706  EXECMODAL_CLOSE = 0,
3707 
3709  EXECMODAL_OK = 1,
3710 
3712  EXECMODAL_CANCEL = 2
3713  };
3714 
3720  FCResourceWindow(int resid);
3721 
3723  virtual ~FCResourceWindow();
3724 
3726  void DestroyWindow();
3727 
3729  virtual void InitWindow();
3730 
3734  virtual void CloseWindow();
3735 
3737  __FCUserWindow* GetParent() { return _pParent; }
3738 
3740  void ShowModeless(EWND hParent);
3741 
3746  void ShowModeless(__FCUserWindow* pParent);
3747 
3753 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
3754  EXECMODAL_RETURNS
3755 #else
3756  twobyte
3757 #endif
3758  ExecuteModal_EWND(EWND hParent);
3759 
3774 #ifndef PDK_FRAMEWORK_LUAFRIENDLY
3775  EXECMODAL_RETURNS
3776 #else
3777  twobyte
3778 #endif
3779  ExecuteModal(__FCUserWindow *pParent);
3780 
3781 #if OPERATING_SYSTEM == WINDOWS
3782 
3783  virtual bool HandleWMNotify(WPARAM wparam, LPARAM lparam);
3784 #endif
3785 
3786 
3788  void _SetupInternalWindowCode();
3789 
3792  {
3793  Add(pControl); // Add must be before SetParent (for the Mac)
3794  pControl->SetParent(this);
3795  return pControl;
3796  }
3797 
3799  FCCtrlLine* AddLine(twobyte id) {
3800  return (FCCtrlLine*) AddCtrl(new FCCtrlLine(id));
3801  }
3802 
3805  {
3806  return (FCCtrlStatic*) AddCtrl(new FCCtrlStatic(id));
3807  }
3808 
3811  {
3812  return (FCCtrlComboBox*) AddCtrl(new FCCtrlComboBox(id));
3813  }
3814 
3816  FCCtrlEdit* AddEdit(twobyte id) {
3817  return (FCCtrlEdit*) AddCtrl(new FCCtrlEdit(id));
3818  }
3819 
3821  FCCtrlPopup* AddPopup(twobyte id) {
3822  return (FCCtrlPopup*) AddCtrl(new FCCtrlPopup(id));
3823  }
3824 
3826  FCCtrlListBox* AddListBox(twobyte id) {
3827  return (FCCtrlListBox*) AddCtrl(new FCCtrlListBox(id));
3828  }
3829 
3831  FCCtrlButton* AddButton(twobyte id) {
3832  return (FCCtrlButton*) AddCtrl(new FCCtrlButton(id));
3833  }
3834 
3836  FCCtrlSlider* AddSlider(twobyte id) {
3837  return (FCCtrlSlider*)AddCtrl(new FCCtrlSlider(id));
3838  }
3839 
3842  return (FCCtrlRadioButton*) AddCtrl(new FCCtrlRadioButton(id));
3843  }
3844 
3847  return (FCCtrlCheckbox*) AddCtrl(new FCCtrlCheckbox(id));
3848  }
3849 
3851  FCCtrlUpDown* AddUpDown(twobyte id) {
3852  return (FCCtrlUpDown*) AddCtrl(new FCCtrlUpDown(id));
3853  }
3854 
3857  {
3858  return (FCCtrlDataList*) AddCtrl(new FCCtrlDataList(id));
3859  }
3860 
3862  FCCtrlTree* AddTree(twobyte id)
3863  {
3864  return (FCCtrlTree*) AddCtrl(new FCCtrlTree(id));
3865  }
3866 
3867 };
3868 
3869 #ifndef DOXYGEN_SHOULD_IGNORE_THIS
3870 #define __IDRESOURCE_CUSTOMWINDOW 5001
3871 #endif /* #ifndef DOXYGEN_SHOULD_IGNORE_THIS */
3872 
3873 
3897 {
3903  int _CalcAvailableCtrlID()
3904  {
3905  int tryid = 10001;
3906  for (int i = 0; i < GetCount(); i++)
3907  {
3908  FCControl* pControl = GetItemAt(i);
3909  int testid = pControl->GetControlID();
3910  if ((testid >= tryid) && (testid < 20000))
3911  {
3912  tryid = testid + 1;
3913  }
3914  }
3915  return tryid;
3916  }
3917 
3919  FCControl* _AddCreatedCtrl(FCControl* pControl, float x, float y)
3920  {
3921  if (!pControl) return pControl;
3922  Add(pControl); // Add must be before SetParent (for the Mac)
3923  pControl->_SetPointsMeasurement(true);
3924  pControl->SetParent(this);
3925  pControl->_SetProgrammaticallyCreate(true);
3926  pControl->SetLeft(x);
3927  pControl->SetTop(y);
3928  return pControl;
3929  }
3930 
3935  FCControl* _AddCreatedCtrl_NoPos(FCControl* pControl)
3936  {
3937  if (!pControl) return pControl;
3938  Add(pControl); // Add must be before SetParent (for the Mac)
3939  pControl->_SetPointsMeasurement(true);
3940  pControl->SetParent(this);
3941  pControl->_SetProgrammaticallyCreate(true);
3942  return pControl;
3943  }
3944 
3949  void _MoveAllControls(int horizoffset, int vertoffset);
3950 
3955  void _CalcControlsExtent(float *pLeftMin, float* pTopMin, float* pRightMax, float* pBottomMax);
3956 
3961  virtual void _InitNonWindowHandleStates();
3962 public:
3967  FCCustomWindow() : FCResourceWindow(__IDRESOURCE_CUSTOMWINDOW)
3968  {
3969  _SetPointsMeasurement(true);
3970  }
3971 
3982  FCCtrlStatic* CreateStatic(float x, float y) { return (FCCtrlStatic*) _AddCreatedCtrl(new FCCtrlStatic(_CalcAvailableCtrlID()), x, y); }
3983 
3994  FCCtrlEdit* CreateEdit(float x, float y) { return (FCCtrlEdit*) _AddCreatedCtrl(new FCCtrlEdit(_CalcAvailableCtrlID()), x, y); }
3995 
4006  FCCtrlButton* CreateButton(float x, float y) { return (FCCtrlButton*) _AddCreatedCtrl(new FCCtrlButton(_CalcAvailableCtrlID()), x, y); }
4007 
4018  FCCtrlCheckbox* CreateCheckbox(float x, float y) { return (FCCtrlCheckbox*) _AddCreatedCtrl(new FCCtrlCheckbox(_CalcAvailableCtrlID()), x, y); }
4019 
4030  {
4031  if (FindControl(1)) return NULL;
4032  FCCtrlButton* pOkButton = (FCCtrlButton*) _AddCreatedCtrl_NoPos(new FCCtrlButton(1));
4033  pOkButton->SetAction(FCControl::ACTION_OK);
4034  FCString oktext("Ok");
4035  pOkButton->SetText(&oktext);
4036  return pOkButton;
4037  }
4038 
4049  {
4050  if (FindControl(2)) return NULL;
4051  FCCtrlButton* pCancelButton = (FCCtrlButton*) _AddCreatedCtrl_NoPos(new FCCtrlButton(2));
4052  pCancelButton->SetAction(FCControl::ACTION_CANCEL);
4053  FCString canceltext("Cancel");
4054  pCancelButton->SetText(&canceltext);
4055  return pCancelButton;
4056  }
4057 
4068  FCCtrlPopup* CreatePopup(float x, float y) { return (FCCtrlPopup*) _AddCreatedCtrl(new FCCtrlPopup(_CalcAvailableCtrlID()), x, y); }
4069 
4082  FCCtrlLine* CreateHorizontalLine(float x, float y, float width)
4083  {
4084  FCCtrlLine* pLine = (FCCtrlLine*) _AddCreatedCtrl(new FCCtrlLine(_CalcAvailableCtrlID()), x, y);
4085  pLine->SetHorizontal(true);
4086  pLine->SetWidth(width);
4087  return pLine;
4088  }
4089 
4102  FCCtrlLine* CreateVerticalLine(float x, float y, float height)
4103  {
4104  FCCtrlLine* pLine = (FCCtrlLine*) _AddCreatedCtrl(new FCCtrlLine(_CalcAvailableCtrlID()), x, y);
4105  pLine->SetHorizontal(false);
4106  pLine->SetHeight(height);
4107  return pLine;
4108  }
4109 
4120  FCCtrlSlider* CreateSlider(float x, float y) { return (FCCtrlSlider*) _AddCreatedCtrl(new FCCtrlSlider(_CalcAvailableCtrlID()), x, y); }
4121 
4132  FCCtrlListBox* CreateListBox(float x, float y) { return (FCCtrlListBox*) _AddCreatedCtrl(new FCCtrlListBox(_CalcAvailableCtrlID()), x, y); }
4133 
4144  FCCtrlUpDown* CreateUpDown(float x, float y) { return (FCCtrlUpDown*) _AddCreatedCtrl(new FCCtrlUpDown(_CalcAvailableCtrlID()), x, y); }
4145 
4157  FCCtrlRadioButtonGroup* CreateRadioButtonGroup(float x, float y, int no_of_items)
4158  {
4159  if (no_of_items < 1) return NULL;
4160  if (no_of_items > 20) return NULL;
4161  return (FCCtrlRadioButtonGroup*) _AddCreatedCtrl(new FCCtrlRadioButtonGroup(_CalcAvailableCtrlID(), no_of_items), x, y);
4162  }
4163 
4174  FCCtrlTree* CreateTree(float x, float y) { return (FCCtrlTree*) _AddCreatedCtrl(new FCCtrlTree(_CalcAvailableCtrlID()), x, y); }
4175 
4186  FCCtrlSwitcher* CreateSwitcher(float x, float y) { return (FCCtrlSwitcher*) _AddCreatedCtrl(new FCCtrlSwitcher(_CalcAvailableCtrlID()), x, y); }
4187 
4188 #ifdef PDK_FRAMEWORK_CANVASCTRL
4189  FCCtrlCanvas* CreateCanvas(float x, float y) { return (FCCtrlCanvas*) _AddCreatedCtrl(new FCCtrlCanvas(_CalcAvailableCtrlID()), x, y); }
4190 #endif
4191 
4202  FCCtrlDataList* CreateDataList(float x, float y) { return (FCCtrlDataList*) _AddCreatedCtrl(new FCCtrlDataList(_CalcAvailableCtrlID()), x, y); }
4203 };
4204 
4205 #endif /* #ifdef PDK_FRAMEWORK_DIALOGS */
4206 
4207 #endif /* FF_DIALOGS_H */
4208 
void SetLeft(float pos)
Sets the left position of the control.
Definition: finaleframework.cpp:22503
A control to switch between multiple pages.
Definition: ff_dialogs.h:3310
FCCtrlEdit * AddEdit(twobyte id)
Links an edit field object to the dialog resource.
Definition: ff_dialogs.h:3816
Control class for sliders.
Definition: ff_dialogs.h:3576
__FCBase * GetItemAt(int index)
Returns the object at the index position. Index is 0-based.
Definition: finaleframework.cpp:12797
void SetTop(float pos)
Sets the top position of the control.
Definition: finaleframework.cpp:22535
static void DebugOutString(const char *pszPrefixText, const char *thestring)
Static method that outputs a line for debugging purposes (C string version). The text appears with th...
Definition: finaleframework.cpp:375
FCCtrlComboBox * AddComboBox(twobyte id)
Links a combo box object to the dialog resource.
Definition: ff_dialogs.h:3810
FCCtrlUpDown * CreateUpDown(float x, float y)
Creates and connects a up/down (stepper) control to the window.
Definition: ff_dialogs.h:4144
void ClearAll()
Destroys all the objects in the collection and empties the collection.
Definition: ff_basecollection.h:130
int GetSiblingCount()
Returns the number of childen that the node's parent has.
Definition: ff_dialogs.h:2964
FCFolderBrowseDialog(FCUI *pUI)
The constructor.
Definition: ff_dialogs.h:303
void SetClientWidth(float newwidth)
Changes the width of the window client area.
Definition: finaleframework.cpp:23233
int GetColumnCount()
Returns the number of columns.
Definition: ff_dialogs.h:2630
int GetAssignedID()
Gets the connected ID regardless of platform.
Definition: ff_dialogs.h:1477
bool WindowExists()
Returns true if a valid parent window handle (and control handle) is available.
Definition: ff_dialogs.h:1412
virtual void SetVisible(bool bShow)
Sets the visibility of the control.
Definition: finaleframework.cpp:22419
FCControl * GetItemAt(int index)
Overloaded implementation of GetItemAt().
Definition: ff_dialogs.h:773
void SetTitle(FCString *pTitle)
Sets the caption (title) for the window.
Definition: finaleframework.cpp:23333
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_dialogs.h:1932
virtual void ResizeRelative(float horizresize, float vertresize)
Resizes the control relatively to the current size. Top left corner will stay fixed.
Definition: finaleframework.cpp:22727
virtual void HandleResize(int newwidth, int newheight, int oldwidth, int oldheight)
Handler called when user resizes the window.
Definition: ff_dialogs.h:1074
float GetStoredWidth()
Returns the stored width. -1 if no width has been stored.
Definition: finaleframework.cpp:23426
void SetFontSize(int size)
Sets the font size of the tree control.
Definition: ff_dialogs.h:3210
float GetMaximumResizeHeight()
Returns the maximum resize height for resizable dialogs/windows.
Definition: ff_dialogs.h:947
FCCtrlCheckbox(twobyte id)
The constructor.
Definition: ff_dialogs.h:3478
virtual void SetKeyboardFocus()
Sets the keyboard focus to the control.
Definition: finaleframework.cpp:22491
bool TryToCloseWindow()
Tries to close the window. This method calls the CanClose() virtual method before calling CloseWindow...
Definition: ff_dialogs.h:873
float GetLeft()
Returns the left position of the control.
Definition: finaleframework.cpp:22513
A list box control.
Definition: ff_dialogs.h:2673
FCControl * AddCtrl(FCControl *pControl)
Adds a control object to the dialog collection.
Definition: ff_dialogs.h:3791
void SetFolderPath(FCString *pString)
Sets the default folder path. This is the path that will be preselected when the dialog is displayed...
Definition: ff_dialogs.h:317
virtual void HandleUpDownPressed(FCControl *pControl, int delta)
Virtual handler method for up/down arrow controls when they are clicked. Overwrite to provide functio...
Definition: ff_dialogs.h:1042
void SetFontSize(int fontsize)
Sets the font size for the data list. This affects Cocoa only.
Definition: ff_dialogs.h:2416
FCCtrlLine * AddLine(twobyte id)
Links a line object to the dialog resource.
Definition: ff_dialogs.h:3799
__FCUserWindow * GetParent()
Returns the parent window object for the control.
Definition: ff_dialogs.h:1408
void SetThreeStatesMode(bool allow3states)
Enables the 3-states mode for a checkbox.
Definition: ff_dialogs.h:3506
void SetInitFolder(FCString *pString)
Sets the initial starting folder for the dialog box.
Definition: ff_dialogs.h:132
virtual void HandleActivate(bool activated)
Virtual method that is called when the window is activated or deactivated. Overwrite in child classes...
Definition: ff_dialogs.h:1068
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_dialogs.h:1847
void SetHeight(float height)
Sets the height of the control.
Definition: finaleframework.cpp:22624
bool AddCopy(FCString *pString)
Adds a copy of the FCString object to the string collection.
Definition: ff_basecollection.h:943
void SetWindowTitle(FCString *pString)
Sets the title for the dialog box.
Definition: ff_dialogs.h:325
void _SetFileNames(FCStrings *pStrings)
For internal use only!
Definition: ff_dialogs.h:243
FCCtrlDataList(twobyte id)
The constructor.
Definition: ff_dialogs.h:2398
CONTROL_ACTIONS
Predefined actions for controls.
Definition: ff_dialogs.h:1262
void Clear()
Creates an empty string.
Definition: ff_base.h:1831
FCCtrlRadioButton * AddRadioButton(twobyte id)
Links a radio button object to the dialog resource.
Definition: ff_dialogs.h:3841
FCCtrlStatic * CreateStatic(float x, float y)
Adds a static text object to the window.
Definition: ff_dialogs.h:3982
FCCtrlUpDown(twobyte id)
The constructor.
Definition: ff_dialogs.h:1710
void StartBufferControlMovement()
Marks a start of buffered movement for the controls in the dialog.
Definition: finaleframework.cpp:23600
FCCustomWindow()
The constructor.
Definition: ff_dialogs.h:3967
FCCtrlLine(twobyte id)
The constructor.
Definition: ff_dialogs.h:1850
float GetTop()
Returns the top position of the control.
Definition: finaleframework.cpp:22545
void GetWindowTitle(FCString *pString)
Copies the initialized window title to a FCString object.
Definition: ff_dialogs.h:142
void SetTextAndResize(FCString *pString)
Cocoa only: Sets the text and resizes the view inside a NSScrollView.
Definition: finaleframework.cpp:22321
bool GetIsContainer()
Returns true if the node is set to be a container (that can contain subnodes).
Definition: ff_dialogs.h:2922
virtual void HandleSwitcherSelect(FCCtrlSwitcher *pControl, int switchindex)
Virtual method that is called when a switcher control is clicked. Please note that switcher selection...
Definition: finaleframework.cpp:23053
virtual void SetEnable(bool state)
Sets the enable/grayed state of the control (if user input should be allowed or not).
Definition: ff_dialogs.h:1855
HWND _GetWinControlHandle()
For internal use only. Returns to handle for the control.
Definition: ff_dialogs.h:1439
virtual void GetText(FCString *pString)
Gets the text of the control.
Definition: finaleframework.cpp:22382
float GetMinimumResizeWidth()
Returns the minimum resize width for resizable dialogs/windows.
Definition: ff_dialogs.h:928
bool AssureFileExtension(const char *pszSuffix)
Makes sure that a file extension exists for the file name. If one is missing, the suffix is added...
Definition: ff_dialogs.h:177
void Hide()
Hides the window.
Definition: finaleframework.cpp:22970
float GetHeight()
Returns the height of the control.
Definition: finaleframework.cpp:22566
Class that handles a contol with multiple lines of data, arranged in columns.
Definition: ff_dialogs.h:2357
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_dialogs.h:1719
void _SetModelessEnabledState()
For internal use only.
Definition: finaleframework.cpp:23116
void SetHorizontal(bool horiz)
Sets the line style to horizontal or vertical. This is only used for programmatically created lines...
Definition: ff_dialogs.h:1875
FCCtrlCheckbox * CreateCheckbox(float x, float y)
Creates and connects a checkbox control to the window.
Definition: ff_dialogs.h:4018
virtual bool GetEnable()
Returns the enable/grayed state of the control (if user input should be allowed or not)...
Definition: finaleframework.cpp:22305
FCCtrlStatic(twobyte id)
The constructor.
Definition: ff_dialogs.h:1904
FCStrings * _GetFilters()
For internal use only!
Definition: ff_dialogs.h:87
UI class that handles a combo box, which is a combination of a edit field and a popup list...
Definition: ff_dialogs.h:2254
void SetStrings(FCStrings *pStrings)
Sets a string collection to the popup part of the combo box.
Definition: ff_dialogs.h:2279
FCCtrlPopup * AddPopup(twobyte id)
Links a popup object to the dialog resource.
Definition: ff_dialogs.h:3821
void AddFilter(FCString *pFilter, FCString *pFilterDescription)
Adds a file filter with description. Multiple filters can be added.
Definition: ff_dialogs.h:72
bool GetVisible()
Returns the visibility state of a control.
Definition: finaleframework.cpp:22478
FCControl(twobyte id)
The constructor.
Definition: ff_dialogs.h:1318
Control class for a checkbox control.
Definition: ff_dialogs.h:3458
Simple collection class for FCNumber class objects.
Definition: ff_basecollection.h:329
bool GetThreeStatesMode() const
Returns the 3-states mode for the checkbox.
Definition: ff_dialogs.h:3515
FCCtrlStatic * AddStatic(twobyte id)
Links a static text object to the dialog resource.
Definition: ff_dialogs.h:3804
bool IsInBufferMode()
Returns true if buffered movement has been started with StartBufferControlMovement.
Definition: ff_dialogs.h:1183
FCCtrlEdit(twobyte id)
The constructor.
Definition: ff_dialogs.h:1935
int GetRootCount()
Returns the number of container nodes in the tree.
Definition: ff_dialogs.h:3252
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_dialogs.h:2704
void MoveRelative(float horizmove, float vertmove)
Moves the control relatively to the current position.
Definition: finaleframework.cpp:22647
FCCtrlPopup * CreatePopup(float x, float y)
Creates and connects a popup/drop-down list control to the window.
Definition: ff_dialogs.h:4068
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_dialogs.h:2258
Definition: ff_dialogs.h:1237
virtual bool CanClose()
Virtual method that decides if the window can close or not.
Definition: ff_dialogs.h:1113
void SetEnabled(bool state)
Sets the enabled state of the window.
Definition: finaleframework.cpp:23107
void _WinSetRestorePositionCalled(bool value)
For internal use only - Windows only!
Definition: ff_dialogs.h:1193
void _SetLastCommandModifierKeys(FLAG_32 value)
For internal use only.
Definition: ff_dialogs.h:680
virtual void SetText(FCString *pString)
Sets the text for the control.
Definition: finaleframework.cpp:22338
void SetWindowAlpha(twobyte alphapercent)
Sets the transparency for the window.
Definition: finaleframework.cpp:23568
void SetTimer(twobyte timerID, ufourbyte msInterval)
Creates a timer with the supplied ID and the timeout/refresh interval. (Timers are not supported in m...
Definition: finaleframework.cpp:23070
float GetWidth()
Returns the width of the control.
Definition: finaleframework.cpp:22583
int GetRootIndexOf(FCTreeNode *pNode)
Returns the index of a node that appears at root level.
Definition: ff_dialogs.h:3283
virtual bool HandleCommand(FCControl *pControl)
Virtual method that is called when a user command occurs, such as a button press. ...
Definition: ff_dialogs.h:1024
Class to display the operating system's "Open File" modal dialog box.
Definition: ff_dialogs.h:199
int GetCount() const
Returns the number of elements of the collection.
Definition: ff_basecollection.h:86
void SetUseFinaleAPI(bool state)
Sets if the native Finale API for folder browsing should be used on Finale 25 and above...
Definition: ff_dialogs.h:338
FCCtrlButton * CreateOkButton()
Creates an "Ok" push button, with default positioning and appearance/behaviour.
Definition: ff_dialogs.h:4029
void StopTimer(twobyte timerID)
Destroys a previously created timer (created with SetTimer()).
Definition: finaleframework.cpp:23091
bool GetPointsMeasurement()
Returns if the measurements and positioning is in points or in a system-native unit for this window...
Definition: ff_dialogs.h:734
void SetRestorePositionData(float x, float y, float width, float height)
Sets the restore position and size.
Definition: finaleframework.cpp:23392
void SetString(FCString *pString)
Copies a string.
Definition: finaleframework.cpp:2132
__FCUserWindow()
The constuctor.
Definition: ff_dialogs.h:706
__FCFileDialogBase(FCUI *pUI)
The constructor.
Definition: ff_dialogs.h:54
virtual ~FCControl()
Destructor.
Definition: ff_dialogs.h:1331
virtual void InitWindow()
Called once just when the window/dialog has been created.
Definition: finaleframework.cpp:23009
FCCtrlSlider * CreateSlider(float x, float y)
Creates and connects a horizontal slider control to the window.
Definition: ff_dialogs.h:4120
FCString * GetItemAt(int index)
Overridden GetItemAt() method.
Definition: ff_basecollection.h:958
COMMAND_MOD_KEYS
Constants for the QueryLastCommandModifierKeys() method.
Definition: ff_dialogs.h:686
void SetWidth(float width)
Sets the width of the control.
Definition: finaleframework.cpp:22600
void GetWindowTitle(FCString *pString)
Gets the assigned dialog title.
Definition: ff_dialogs.h:358
int GetIndex()
Returns the index of the item within the parent container.
Definition: ff_dialogs.h:2952
bool Execute()
Displays the dialog box to the user.
Definition: finaleframework.cpp:26838
FCCtrlSlider(twobyte id)
The costructor.
Definition: ff_dialogs.h:3597
Definition: ff_dialogs.h:701
void SetMultiSelect(bool value)
Sets the dialog to allow multiple selections.
Definition: ff_dialogs.h:219
float GetMinimumResizeHeight()
Returns the minimum resize height for resizable dialogs/windows.
Definition: ff_dialogs.h:934
Base class that contains the basic functionality for the operating system's modal dialog boxes for se...
Definition: ff_dialogs.h:40
int GetConnectedLineIndex()
Returns the connected 0-based line index in the control.
Definition: ff_dialogs.h:2342
FCCtrlSwitcher(twobyte id)
The constructor.
Definition: ff_dialogs.h:3335
void SetAction(CONTROL_ACTIONS action)
Sets the dialog acction assigned to the control.
Definition: ff_dialogs.h:1489
FCCtrlDataList * CreateDataList(float x, float y)
Creates and connects a data list view control to the window.
Definition: ff_dialogs.h:4202
FCControl * FindControl(int controlid)
Finds a control based on the control's ID.
Definition: finaleframework.cpp:23060
Standard class for basic user interface functionality.
Definition: ff_ui.h:25
virtual void SetEnable(bool state)
Sets the enable/grayed state of the control (if user input should be allowed or not).
Definition: finaleframework.cpp:22287
virtual void OkButtonPressed()
Virtual handler method that is called when a control with a "OK" action is pressed by the user...
Definition: ff_dialogs.h:998
virtual void HandleDataListCheck(FCCtrlDataList *pControl, int lineindex, bool checkstate)
Virtual handler method for when FCCtrlDataList check state changes (for data list controls with check...
Definition: ff_dialogs.h:1062
float GetMaximumResizeWidth()
Returns the maximum resize width for resizable dialogs/windows.
Definition: ff_dialogs.h:941
int GetIndexOf(__FCBase *pObject)
Returns the 0-based order index for the object within the collection.
Definition: finaleframework.cpp:12805
FCCtrlCheckbox * AddCheckbox(twobyte id)
Links a checkbox object to the dialog resource.
Definition: ff_dialogs.h:3846
FCFileOpenDialog(FCUI *pUI)
The constructor.
Definition: ff_dialogs.h:210
twobyte GetModalResult()
Definition: ff_dialogs.h:677
FCCtrlRadioButtonGroup(twobyte id, int no_of_items)
The constructor.
Definition: ff_dialogs.h:3446
CONTROL_ACTIONS GetAction()
Returns the dialog acction assigned to the control.
Definition: ff_dialogs.h:1483
void AddFloat(float afloat)
Appends an integer number to the collection.
Definition: ff_basecollection.h:379
FCCtrlEdit * CreateEdit(float x, float y)
Adds an edit control object to the window.
Definition: ff_dialogs.h:3994
void ShowAndActivate()
Makes the window visible and sets it focused.
Definition: finaleframework.cpp:22980
void SetClientHeight(float newheight)
Changes the height of the window client area (excluding the title bar).
Definition: finaleframework.cpp:23277
void GetTitle(FCString *pTitle)
Gets the caption (title) for the window.
Definition: finaleframework.cpp:23351
Base class for the Finale Framework classes.
Definition: ff_base.h:47
virtual bool Execute()=0
Virtual method that's overridden in all child methods. Executes the dialog box.
float GetStoredHeight()
Returns the stored height. -1 if no height has been stored.
Definition: finaleframework.cpp:23432
float GetWidth()
Returns the current width of the window frame.
Definition: finaleframework.cpp:23170
UI class representing a graphical line.
Definition: ff_dialogs.h:1836
FCCtrlListBox * CreateListBox(float x, float y)
Creates and connects a list box control to the window.
Definition: ff_dialogs.h:4132
bool QueryLastCommandModifierKeys(FLAG_32 modifiers)
Returns if the user held down a specific set of modifier keys at the last "command" event...
Definition: ff_dialogs.h:857
Class for radio button groups.
Definition: ff_dialogs.h:3441
virtual void HandleCheckChange(int lineindex, bool state)
Called every time there's a user check change on any of the items.
Definition: ff_dialogs.h:2595
virtual void CloseWindow()=0
Closes the window. Functionality is provided by the child classes.
FCCtrlPopup(twobyte id)
The constructor.
Definition: ff_dialogs.h:2170
Definition: ff_dialogs.h:689
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_dialogs.h:2167
bool GetPointsMeasurement()
Returns if the measurements and positioning is in points or in a system-native unit.
Definition: ff_dialogs.h:1340
FCCtrlSwitcher * CreateSwitcher(float x, float y)
Creates and connects a page switcher control to the window.
Definition: ff_dialogs.h:4186
void SetWidth(float newwidth)
Changes the width of the window frame.
Definition: finaleframework.cpp:23137
A UI class that handles one single radio button.
Definition: ff_dialogs.h:3404
bool IsVisible()
Returns true if the window is visible.
Definition: finaleframework.cpp:23043
FCCtrlUpDown * AddUpDown(twobyte id)
Links a up/down object to the dialog resource.
Definition: ff_dialogs.h:3851
void GetText(FCString *pString)
Gets the node's text and copies it to a FCString object.
Definition: ff_dialogs.h:2883
bool GetHorizontal()
Returns the line style to horizontal or vertical. This is only used for programmatically created line...
Definition: ff_dialogs.h:1881
bool GetCheck()
Returns the check state of the row.
Definition: ff_dialogs.h:2339
Class for modeless and modal dialogs that are visually designed as a resource. This class is also a p...
Definition: ff_dialogs.h:3691
MEASUREMENTUNITS
Constants for Finale's standard measurement units.
Definition: ff_base.h:212
virtual void HandleUnselect()
Called every time nothing is selected.
Definition: ff_dialogs.h:2588
FCCtrlTree * CreateTree(float x, float y)
Creates and connects a tree view control to the window.
Definition: ff_dialogs.h:4174
HANDLE _GetItemHandle()
For internal use only!
Definition: ff_dialogs.h:2978
static void DebugOutBool(const char *pszPrefixText, bool state)
Static method that outputs a line for debugging purposes. The boolean state appears afterwards as eit...
Definition: finaleframework.cpp:390
virtual void Repaint()
Force a visual update of the control.
Definition: ff_dialogs.h:1450
void Activate()
Activates the window and sets it in user focus.
Definition: finaleframework.cpp:23380
void SetMaximumResizeWidth(int width)
Sets the maximum resize width for resizable dialogs/windows.
Definition: ff_dialogs.h:902
void _WinPostRestorePosition()
For internal use only! On Windows, a position restore has to be made after InitWindow() ...
Definition: ff_dialogs.h:1200
bool WindowExists()
Returns true if the window exists in the user interface.
Definition: finaleframework.cpp:22961
void SetStrings(FCStrings *pStrings)
Sets a string collection to the popup control.
Definition: ff_dialogs.h:2196
FCCtrlButton(twobyte id)
The constructor.
Definition: ff_dialogs.h:3542
void SetMeasurement(float value, twobyte unit)
Sets the string to an EVPU measurement value, formatted to a specific unit.
Definition: finaleframework.cpp:1902
EXECMODAL_RETURNS
The return codes for the ExecuteModal() method.
Definition: ff_dialogs.h:3704
FCTreeNode * GetItemAt(int index)
Overridden version of GetItemAt().
Definition: ff_dialogs.h:2858
UI class that handles a control with static text.
Definition: ff_dialogs.h:1893
void SetWindowTitle(FCString *pString)
Sets the caption of the window title.
Definition: ff_dialogs.h:106
void SetFileName(FCString *pString)
Sets the initial file name string. The string contains the full path to the file name.
Definition: ff_dialogs.h:116
bool ConnectMeasurementEdit(FCCtrlEdit *pControl, double min, double max)
Connects a measurement edit field to an up/down control.
Definition: ff_dialogs.h:1802
void SetHeight(float newheight)
Changes the height of the window frame.
Definition: finaleframework.cpp:23185
void _WinSetInitWindowCalled(bool value)
For internal use only - Windows only!
Definition: ff_dialogs.h:1187
Class to display the operating system's modal folder browser dialog box.
Definition: ff_dialogs.h:290
bool IsModal()
Returns true if the dialog currently is running in a modal state.
Definition: ff_dialogs.h:740
FCCtrlTree * AddTree(twobyte id)
Links a data list to the dialog resource.
Definition: ff_dialogs.h:3862
int GetControlID()
Returns the control ID for the control.
Definition: ff_dialogs.h:1467
void SetUseCheckboxes(bool state)
Sets if checkboxes should be used for the data list. To have any effect, this must be called before t...
Definition: ff_dialogs.h:2497
void CopyFrom(FCStrings *pSourceStrings)
Recreates a string collection. Any existing strings in the collection are cleared. NULL entries in the string table are also supported.
Definition: ff_basecollection.h:1123
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_dialogs.h:3072
void Windowshade(bool windowshade)
Sets the window in a "windowshade" mode (where only the title bar is visible) - or restore the window...
Definition: finaleframework.cpp:23511
FCCtrlRadioButtonGroup * CreateRadioButtonGroup(float x, float y, int no_of_items)
Creates and connects a radio button group to the window.
Definition: ff_dialogs.h:4157
Base class for all other dialog/window classes.
Definition: ff_dialogs.h:576
Class that provides storage for text. This is to achieve platform-transparent text handling...
Definition: ff_base.h:1473
void SetDefaultFilter(int index)
Sets the 0-based default filter.
Definition: ff_dialogs.h:95
Class that handles edit controls.
Definition: ff_dialogs.h:1924
bool SetSelectedLast()
Selects the last item in the list box.
Definition: ff_dialogs.h:2749
void GetFolderPath(FCString *pString)
Gets the folder path.
Definition: ff_dialogs.h:346
FCTreeNode * GetRootItemAt(int index)
Returns the root node at the 0-based index position.
Definition: ff_dialogs.h:3262
Definition: ff_dialogs.h:692
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_dialogs.h:1901
bool GetUseFinaleAPI() const
Returns if the native Finale API for folder browsing should be used on Finale 25 and above...
Definition: ff_dialogs.h:375
virtual void SetBold(bool state)
Sets the boldface appearance for the control.
Definition: finaleframework.cpp:22437
FCCtrlListBox * AddListBox(twobyte id)
Links a list box object to the dialog resource.
Definition: ff_dialogs.h:3826
bool GetMultiSelect() const
Returns the state controlling if the dialog will allow multiple selections.
Definition: ff_dialogs.h:226
virtual void CloseButtonPressed()
Virtual method that is called when a control with a "Close" action is pressed by the user...
Definition: ff_dialogs.h:983
void SetRestorePositionOnlyData(float x, float y)
Sets the restore position, but with no size.
Definition: finaleframework.cpp:23403
virtual void HandleSelectChange(int lineindex)
Called every time there's a user row selection change on any of the items.
Definition: ff_dialogs.h:2575
bool GetUseCheckboxes() const
Returns if checkboxes should be used for the data list.
Definition: ff_dialogs.h:2488
UI class that handles a popup (on the Mac) and a combo list (on Windows).
Definition: ff_dialogs.h:2149
float GetClientWidth()
Returns the current width of the window client area.
Definition: finaleframework.cpp:23264
FCCtrlButton * CreateCancelButton()
Creates a "Cancel" push button, with default positioning and appearance/behaviour.
Definition: ff_dialogs.h:4048
float GetStoredX()
Returns the stored horizonal position, for use in the restore feature.
Definition: finaleframework.cpp:23414
Definition: ff_dialogs.h:698
void GetFileName(FCString *pString)
Copies the file name to a FCString object.
Definition: ff_dialogs.h:153
FCCtrlEdit * GetConnectedEdit()
Returns the connected edit control (if any).
Definition: ff_dialogs.h:1756
FCCtrlButton * AddButton(twobyte id)
Links a button object to the dialog resource.
Definition: ff_dialogs.h:3831
FCCtrlDataList * AddDataList(twobyte id)
Links a tree view to the dialog resource.
Definition: ff_dialogs.h:3856
float GetMeasurementEfix(_ENUMCODE(MEASUREMENTUNITS) _LUACODE(twobyte) measurementunit)
Gets the measurement value in EFIXes from the edit field.
Definition: ff_dialogs.h:1997
Collection class for FCString class objects.
Definition: ff_basecollection.h:924
FCFileSaveAsDialog(FCUI *pUI)
The constructor.
Definition: ff_dialogs.h:269
__FCUserWindow * GetParent()
Returns the parent window object.
Definition: ff_dialogs.h:3737
Class to display the operating system's "Save File As" modal dialog box.
Definition: ff_dialogs.h:263
void SetText(FCString *pText)
Sets the text for the node. This method will also visually update the node.
Definition: ff_dialogs.h:2868
Control class for push buttons. It inherits the FCCtrlCheckbox class, so the checked state can be set...
Definition: ff_dialogs.h:3532
float GetRangeMeasurementEfix(_ENUMCODE(MEASUREMENTUNITS) _LUACODE(twobyte) measurementunit, float min, float max)
Gets the measurement value in EFIXes from the edit field, within a specific range.
Definition: ff_dialogs.h:2021
FCDataListRow()
The constructor.
Definition: ff_dialogs.h:2328
FCCtrlLine * CreateHorizontalLine(float x, float y, float width)
Creates and connects a horizontal line control to the window.
Definition: ff_dialogs.h:4082
FCCtrlTree(twobyte id)
The constructor.
Definition: ff_dialogs.h:3044
FCTreeNode * GetParentNode()
Returns the tree node's owner object.
Definition: ff_dialogs.h:2944
FCString * GetTextPtr()
Returns the direct pointer to the text object.
Definition: ff_dialogs.h:2890
virtual bool GetEnable()
Returns the enable/grayed state of the control (if user input should be allowed or not)...
Definition: ff_dialogs.h:1862
virtual void HandleDataListSelect(FCCtrlDataList *pControl, int lineindex)
Virtual handler method for when FCCtrlDataList selection state changes. Overwrite to provide function...
Definition: ff_dialogs.h:1051
void SetMeasurementEfix(float value, _ENUMCODE(MEASUREMENTUNITS) _LUACODE(twobyte) measurementunit)
Sets the EFIX value to the edit field, using the indicated measurement unit.
Definition: ff_dialogs.h:2057
void GetFileNames(FCStrings *pStrings)
Gets the string collection with all selected file names, if multiple selection has been enabled for t...
Definition: ff_dialogs.h:236
void MoveAbsolute(float x, float y)
Moves the control in absolute coordinates.
Definition: finaleframework.cpp:22693
void Add(__FCBase *pNewItem)
Adds an element to the end of the collection.
Definition: finaleframework.cpp:12756
A class that represents one row of data in a FCCtrlDataList UI control.
Definition: ff_dialogs.h:2310
void GetInitFolder(FCString *pString)
Copies the init folder to a FCString object.
Definition: ff_dialogs.h:163
virtual void HandleTimer(twobyte timerID)
Virtual handler method that is called on timer events. Overwrite in child classes.
Definition: ff_dialogs.h:1065
void AppendCString(const char *pOtherString)
Appends a C-style string to the string.
Definition: finaleframework.cpp:1636
virtual void CancelButtonPressed()
Virtual handler method that is called when a control with a "Cancel" action is pressed by the user...
Definition: ff_dialogs.h:1013
virtual void DebugDump()
Outputs the class data/information for debugging purposes.
Definition: ff_dialogs.h:2992
bool ConnectIntegerEdit(FCCtrlEdit *pControl, int min, int max)
Connects an integer edit field to an up/down control.
Definition: ff_dialogs.h:1776
FCCtrlRadioButton(twobyte id)
The constructor.
Definition: ff_dialogs.h:3421
FCCtrlComboBox(twobyte id)
The constructor.
Definition: ff_dialogs.h:2261
Definition: ff_dialogs.h:695
FCCtrlSlider * AddSlider(twobyte id)
Links a slider object to the dialog resource.
Definition: ff_dialogs.h:3836
void StorePosition(bool storesize)
Stores the window position for use with RestorePosition.
Definition: finaleframework.cpp:23438
FCCtrlDataList * GetConnectedList()
Returns the connected FCCtrlDataList control.
Definition: ff_dialogs.h:2345
void ExtractFileExtension()
Removes everything except the file extension part of a file name.
Definition: ff_base.h:2097
bool EndBufferControlMovement()
Resizes/moves all buffered control movements made since the StartBufferControlMovement call...
Definition: finaleframework.cpp:23611
bool RestorePosition()
Restores the window's position and size (if the size is stored).
Definition: finaleframework.cpp:23462
Class representing a single node item in a FCCtrlTree control.
Definition: ff_dialogs.h:2816
float GetClientHeight()
Returns the current height of the window client area, excluding the title bar.
Definition: finaleframework.cpp:23318
bool IsWindowshade()
Returns true if the window is in window shade mode.
Definition: ff_dialogs.h:1150
float GetHeight()
Returns the current height of the window frame.
Definition: finaleframework.cpp:23218
void AddInt(int intvalue)
Appends an integer number to the collection.
Definition: ff_basecollection.h:373
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_dialogs.h:2395
A UI class that handles an Up/Down control. The control has 2 arrows, one pointing up and one down...
Definition: ff_dialogs.h:1681
virtual bool Execute()
Displays the dialog box to the user.
Definition: finaleframework.cpp:26770
void SetInteger(int i)
Sets the string to an integer.
Definition: finaleframework.cpp:1875
void SetMaximumResizeHeight(int height)
Sets the maximum resize height for resizable dialogs/windows.
Definition: ff_dialogs.h:916
virtual void HandleDoubleClick()
Called every time there's a double-click inside the data list.
Definition: ff_dialogs.h:2605
Base class for all collection classes. A collection is a storage that can store multiple objects of s...
Definition: ff_basecollection.h:24
FCCtrlButton * CreateButton(float x, float y)
Creates and connects a push button to the window.
Definition: ff_dialogs.h:4006
A tree UI control.
Definition: ff_dialogs.h:3020
float GetStoredY()
Returns the stored vertical position, for use in the restore feature.
Definition: finaleframework.cpp:23420
FCCtrlLine * CreateVerticalLine(float x, float y, float height)
Creates and connects a vertical line control to the window.
Definition: ff_dialogs.h:4102
bool IsEmpty()
Returns true if the string is empty.
Definition: ff_base.h:2461
virtual const char * ClassName()
Returns the name of the class, for diagnostic purposes. This method MUST be overwritten in each child...
Definition: ff_dialogs.h:1310
A class that supports programmatically created controls (that are not defined in resource files)...
Definition: ff_dialogs.h:3896
virtual bool Execute()
Displays the dialog box to the user.
Definition: finaleframework.cpp:26664