| 1 | package App::SeismicUnixGui::misc::whereami; | ||
| 2 | |||
| 3 | =head1 DOCUMENTATION | ||
| 4 | |||
| 5 | |||
| 6 | =head2 SYNOPSIS | ||
| 7 | |||
| 8 | PERL PACKAGE NAME: whereami.pm | ||
| 9 | AUTHOR: Juan Lorenzo | ||
| 10 | DATE: June 22 2017 | ||
| 11 | |||
| 12 | DESCRIPTION | ||
| 13 | |||
| 14 | BASED ON: | ||
| 15 | |||
| 16 | =cut | ||
| 17 | |||
| 18 | =head2 USE | ||
| 19 | |||
| 20 | =head3 NOTES | ||
| 21 | only sets values internally | ||
| 22 | does not modify values outside the package | ||
| 23 | use to locate the user within the gui | ||
| 24 | |||
| 25 | |||
| 26 | =head4 Examples | ||
| 27 | |||
| 28 | |||
| 29 | =head2 CHANGES and their DATES | ||
| 30 | |||
| 31 | |||
| 32 | =cut | ||
| 33 | |||
| 34 | use Moose; | ||
| 35 | our $VERSION = '0.0.1'; | ||
| 36 | use Tk; | ||
| 37 | |||
| 38 | my $true = 1; | ||
| 39 | my $false = 0; | ||
| 40 | |||
| 41 | =head2 private hash references | ||
| 42 | |||
| 43 | 16 off | ||
| 44 | |||
| 45 | =cut | ||
| 46 | |||
| 47 | my $whereami = { | ||
| 48 | _flow_color => '', | ||
| 49 | _is_Save_button => $false, | ||
| 50 | _is_SaveAs_button => $false, | ||
| 51 | _is_add2flow => $false, | ||
| 52 | _is_add2flow_button => $false, | ||
| 53 | _is_check_code_button => $false, | ||
| 54 | _is_delete_from_flow_button => $false, | ||
| 55 | _is_flow_listbox_grey_w => $false, | ||
| 56 | _is_flow_listbox_pink_w => $false, | ||
| 57 | _is_flow_listbox_green_w => $false, | ||
| 58 | _is_flow_listbox_blue_w => $false, | ||
| 59 | _is_moveNdrop_in_flow => $false, | ||
| 60 | _is_sunix_listbox => $false, | ||
| 61 | _is_dragNdrop => $false, | ||
| 62 | _is_flow_select_button => $false, | ||
| 63 | _is_superflow_select_button => $false, | ||
| 64 | _is_run_button => $false, | ||
| 65 | |||
| 66 | }; | ||
| 67 | |||
| 68 | =head2 sub _reset | ||
| 69 | |||
| 70 | 16 off | ||
| 71 | |||
| 72 | =cut | ||
| 73 | |||
| 74 | sub _reset { | ||
| 75 | |||
| 76 | my ($self) = @_; | ||
| 77 | |||
| 78 | $whereami = { | ||
| 79 | _flow_color => '', | ||
| 80 | _is_Save_button => $false, | ||
| 81 | _is_SaveAs_button => $false, | ||
| 82 | _is_add2flow => $false, | ||
| 83 | _is_add2flow_button => $false, | ||
| 84 | _is_check_code_button => $false, | ||
| 85 | _is_delete_from_flow_button => $false, | ||
| 86 | _is_dragNdrop => $false, | ||
| 87 | _is_flow_listbox_grey_w => $false, | ||
| 88 | _is_flow_listbox_pink_w => $false, | ||
| 89 | _is_flow_listbox_green_w => $false, | ||
| 90 | _is_flow_listbox_blue_w => $false, | ||
| 91 | _is_flow_select_button => $false, | ||
| 92 | _is_moveNdrop_in_flow => $false, | ||
| 93 | _is_sunix_listbox => $false, | ||
| 94 | _is_superflow_select_button => $false, | ||
| 95 | _is_run_button => $false, | ||
| 96 | |||
| 97 | }; | ||
| 98 | |||
| 99 | # print("whereami,_reset,_is_sunix_listbox,$whereami->{_is_sunix_listbox}\n"); | ||
| 100 | # print("whereami,_reset,_is_superflow_select_button,$whereami->{_is_superflow_select_button}\n"); | ||
| 101 | return (); | ||
| 102 | } | ||
| 103 | |||
| 104 | =head2 sub get4All | ||
| 105 | |||
| 106 | foreach my $key (sort keys %$here) { | ||
| 107 | print("1. whereami,get4All,key $key, value: $here->{$key}\n"); | ||
| 108 | } | ||
| 109 | |||
| 110 | =cut | ||
| 111 | |||
| 112 | sub get4All { | ||
| 113 | my ($self) = @_; | ||
| 114 | my $here = $whereami; | ||
| 115 | return ($here); | ||
| 116 | } | ||
| 117 | |||
| 118 | =head2 sub reset4All | ||
| 119 | |||
| 120 | foreach my $key (sort keys %$here) { | ||
| 121 | print("1. whereami,get4All,key $key, value: $here->{$key}\n"); | ||
| 122 | } | ||
| 123 | |||
| 124 | =cut | ||
| 125 | |||
| 126 | sub reset4All { | ||
| 127 | my ($self) = @_; | ||
| 128 | _reset(); | ||
| 129 | return (); | ||
| 130 | } | ||
| 131 | |||
| 132 | =head2 sub get4add2flow | ||
| 133 | |||
| 134 | =cut | ||
| 135 | |||
| 136 | sub get4add2flow { | ||
| 137 | my ($self) = @_; | ||
| 138 | |||
| 139 | if ( $whereami->{_is_add2flow} ) { | ||
| 140 | |||
| 141 | my $here; | ||
| 142 | $here->{_is_add2flow} = $whereami->{_is_add2flow}; | ||
| 143 | |||
| 144 | # print("1. whereami,get4add2flow, $here->{_is_add2flow}\n"); | ||
| 145 | return ($here); | ||
| 146 | |||
| 147 | } | ||
| 148 | else { | ||
| 149 | print("1. whereami,get4add2flow, missing whereami->{_is_add2flow}\n"); | ||
| 150 | return (); | ||
| 151 | } | ||
| 152 | |||
| 153 | print("1. whereami,get4add2flow, unexpected \n"); | ||
| 154 | return (); | ||
| 155 | } | ||
| 156 | |||
| 157 | =head2 sub get4add2flow_button | ||
| 158 | |||
| 159 | =cut | ||
| 160 | |||
| 161 | sub get4add2flow_button { | ||
| 162 | my ($self) = @_; | ||
| 163 | my $here; | ||
| 164 | $here->{_is_add2flow_button} = $whereami->{_is_add2flow_button}; | ||
| 165 | |||
| 166 | # print("1. whereami,get4add2flow_button, $here->{_is_add2flow_button}= $here->{_is_add2flow_button}\n"); | ||
| 167 | return ($here); | ||
| 168 | } | ||
| 169 | |||
| 170 | =head2 sub get4check_code_button | ||
| 171 | |||
| 172 | =cut | ||
| 173 | |||
| 174 | sub get4check_code_button { | ||
| 175 | my ($self) = @_; | ||
| 176 | my $here; | ||
| 177 | $here->{_is_check_code_button} = $whereami->{_is_check_code_button}; | ||
| 178 | |||
| 179 | # print("1. whereami,get4check_code_button, $here->{_is_check_code_button}\n"); | ||
| 180 | return ($here); | ||
| 181 | } | ||
| 182 | |||
| 183 | =head2 sub get4delete_from_flow_button | ||
| 184 | |||
| 185 | =cut | ||
| 186 | |||
| 187 | sub get4delete_from_flow_button { | ||
| 188 | my ($self) = @_; | ||
| 189 | my $here; | ||
| 190 | $here->{_is_delete_from_flow_button} = | ||
| 191 | $whereami->{_is_delete_from_flow_button}; | ||
| 192 | |||
| 193 | #print("1. whereami,get4delete_from_flow_button, $here->{_is_delete_from_flow_button}\n"); | ||
| 194 | return ($here); | ||
| 195 | } | ||
| 196 | |||
| 197 | =head2 sub get4dragNdrop | ||
| 198 | |||
| 199 | =cut | ||
| 200 | |||
| 201 | sub get4dragNdrop { | ||
| 202 | my ($self) = @_; | ||
| 203 | my $here; | ||
| 204 | $here->{_is_dragNdrop} = $whereami->{_is_dragNdrop}; | ||
| 205 | |||
| 206 | # print("1. whereami,get4dragNdrop_from_flow_button, $here->{_is_dragNdrop}\n"); | ||
| 207 | return ($here); | ||
| 208 | } | ||
| 209 | |||
| 210 | =head2 sub _get_flow_color | ||
| 211 | |||
| 212 | |||
| 213 | =cut | ||
| 214 | |||
| 215 | sub _get_flow_color { | ||
| 216 | my ($self) = @_; | ||
| 217 | |||
| 218 | if ( $whereami->{_flow_color} ) { | ||
| 219 | |||
| 220 | my $flow_color = $whereami->{_flow_color}; | ||
| 221 | return ($flow_color); | ||
| 222 | |||
| 223 | } | ||
| 224 | else { | ||
| 225 | |||
| 226 | print("whereamin,_get_flow_color, missing color \n "); | ||
| 227 | return (); | ||
| 228 | } | ||
| 229 | |||
| 230 | } | ||
| 231 | |||
| 232 | =head2 sub get4flow_listbox | ||
| 233 | |||
| 234 | TODO: distinguihs between listboxes --grey,pink,green and blue... 4 off | ||
| 235 | |||
| 236 | =cut | ||
| 237 | |||
| 238 | sub get4flow_listbox { | ||
| 239 | |||
| 240 | my ($self) = @_; | ||
| 241 | my $here; | ||
| 242 | my $color = _get_flow_color(); | ||
| 243 | |||
| 244 | # print("whereami,get4flow_listbox, color: $color \n"); | ||
| 245 | |||
| 246 | if ($color) { | ||
| 247 | |||
| 248 | my $is_flow_listbox_color_w_text = '_is_flow_listbox_' . $color . '_w'; | ||
| 249 | $here->{_is_flow_listbox_color_w_text} = | ||
| 250 | $whereami->{$is_flow_listbox_color_w_text}; | ||
| 251 | $here->{_is_flow_listbox_color_w} = | ||
| 252 | $whereami->{_is_flow_listbox_color_w}; | ||
| 253 | |||
| 254 | # print("1. whereami,get4flow_listbox, is_flow_listbox_color_w_text: $here->{_is_flow_listbox_color_w_text}\n"); | ||
| 255 | # print("1. whereami,get4flow_listbox, _is_flow_listbox_color_w: $here->{_is_flow_listbox_color_w}\n"); | ||
| 256 | return ($here); | ||
| 257 | |||
| 258 | } | ||
| 259 | else { | ||
| 260 | |||
| 261 | print(" whereami,get4flow_listbox, missing color \n"); | ||
| 262 | } | ||
| 263 | |||
| 264 | print("1. whereami,get4flow_listbox, unexpected \n"); | ||
| 265 | return (); | ||
| 266 | } | ||
| 267 | |||
| 268 | =head2 sub get4moveNdrop_in_flow | ||
| 269 | |||
| 270 | |||
| 271 | =cut | ||
| 272 | |||
| 273 | sub get4moveNdrop_in_flow { | ||
| 274 | my ($self) = @_; | ||
| 275 | my $here; | ||
| 276 | $here->{_is_moveNdrop_in_flow} = $whereami->{_is_moveNdrop_in_flow}; | ||
| 277 | |||
| 278 | # print("1. whereami,get4moveNdrop_flow, $here->{_is_get4moveNdrop_in_flow}\n"); | ||
| 279 | return ($here); | ||
| 280 | } | ||
| 281 | |||
| 282 | =head2 sub get4run_button | ||
| 283 | |||
| 284 | =cut | ||
| 285 | |||
| 286 | sub get4run_button { | ||
| 287 | my ($self) = @_; | ||
| 288 | my $here; | ||
| 289 | $here->{_is_run_button} = $whereami->{_is_run_button}; | ||
| 290 | |||
| 291 | # print("1. whereami,get4run_button, $here->{_is_run_button}\n"); | ||
| 292 | return ($here); | ||
| 293 | } | ||
| 294 | |||
| 295 | =head2 sub get4flow_select_button | ||
| 296 | |||
| 297 | =cut | ||
| 298 | |||
| 299 | sub get4flow_select_button { | ||
| 300 | my ($self) = @_; | ||
| 301 | my $here; | ||
| 302 | $here->{_is_flow_select_button} = $whereami->{_is_flow_select_button}; | ||
| 303 | |||
| 304 | # print("1. whereami,get4flow_select, $here->{_is_flow_select_button}\n"); | ||
| 305 | return ($here); | ||
| 306 | } | ||
| 307 | |||
| 308 | =head2 sub get4Save_button | ||
| 309 | |||
| 310 | =cut | ||
| 311 | |||
| 312 | sub get4Save_button { | ||
| 313 | my ($self) = @_; | ||
| 314 | my $here; | ||
| 315 | $here->{_is_Save_button} = $whereami->{_is_Save_button}; | ||
| 316 | |||
| 317 | # print("1. whereami,get4Save_button, $here->{_is_Save_button}\n"); | ||
| 318 | return ($here); | ||
| 319 | } | ||
| 320 | |||
| 321 | =head2 sub get4SaveAs_button | ||
| 322 | |||
| 323 | =cut | ||
| 324 | |||
| 325 | sub get4SaveAs_button { | ||
| 326 | my ($self) = @_; | ||
| 327 | my $here; | ||
| 328 | $here->{_is_SaveAs_button} = $whereami->{_is_SaveAs_button}; | ||
| 329 | |||
| 330 | # print("1. whereami,get4SaveAs_button, $here->{_is_SaveAs_button}\n"); | ||
| 331 | return ($here); | ||
| 332 | } | ||
| 333 | |||
| 334 | =head2 sub get4superflow_select_button | ||
| 335 | |||
| 336 | =cut | ||
| 337 | |||
| 338 | sub get4superflow_select_button { | ||
| 339 | my ($self) = @_; | ||
| 340 | my $here; | ||
| 341 | $here->{_is_superflow_select_button} = | ||
| 342 | $whereami->{_is_superflow_select_button}; | ||
| 343 | |||
| 344 | # print("1. whereami,get4superflow_select_button, $here->{_is_sunix_listbox}\n"); | ||
| 345 | return ($here); | ||
| 346 | } | ||
| 347 | |||
| 348 | =head2 sub get4sunix_listbox | ||
| 349 | |||
| 350 | =cut | ||
| 351 | |||
| 352 | sub get4sunix_listbox { | ||
| 353 | my ($self) = @_; | ||
| 354 | my $here; | ||
| 355 | $here->{_is_sunix_listbox} = $whereami->{_is_sunix_listbox}; | ||
| 356 | |||
| 357 | # print("1. whereami,get4sunix_listbox, $here->{_is_sunix_listbox}\n"); | ||
| 358 | return ($here); | ||
| 359 | } | ||
| 360 | |||
| 361 | =head2 sub set4add2flow | ||
| 362 | |||
| 363 | =cut | ||
| 364 | |||
| 365 | sub set4add2flow { | ||
| 366 | my ( $self, $color ) = @_; | ||
| 367 | _reset(); | ||
| 368 | |||
| 369 | # print(" whereami, set4add2flow\n"); | ||
| 370 | $whereami->{_is_add2flow} = $true; | ||
| 371 | |||
| 372 | return (); | ||
| 373 | } | ||
| 374 | |||
| 375 | =head2 sub set4add2flow_button | ||
| 376 | |||
| 377 | =cut | ||
| 378 | |||
| 379 | sub set4add2flow_button { | ||
| 380 | my ($self) = @_; | ||
| 381 | _reset(); | ||
| 382 | $whereami->{_is_add2flow_button} = $true; | ||
| 383 | |||
| 384 | # print("1. whereami,set4add2flow_button, $whereami->{_is_add2flow_button}\n"); | ||
| 385 | return (); | ||
| 386 | } | ||
| 387 | |||
| 388 | =head2 sub set4check_code_button | ||
| 389 | |||
| 390 | =cut | ||
| 391 | |||
| 392 | sub set4check_code_button { | ||
| 393 | my ($self) = @_; | ||
| 394 | _reset(); | ||
| 395 | $whereami->{_is_check_code_button} = $true; | ||
| 396 | print( | ||
| 397 | "1. whereami,set4check_code_button, $whereami->{_is_check_code_button}\n" | ||
| 398 | ); | ||
| 399 | return (); | ||
| 400 | } | ||
| 401 | |||
| 402 | =head2 sub set4delete_from_flow_button | ||
| 403 | |||
| 404 | =cut | ||
| 405 | |||
| 406 | sub set4delete_from_flow_button { | ||
| 407 | my ($self) = @_; | ||
| 408 | _reset(); | ||
| 409 | $whereami->{_is_delete_from_flow_button} = $true; | ||
| 410 | |||
| 411 | # print("1. whereami,set4delete_from_flow_button, $whereami->{_is_delete_from_flow_button}\n"); | ||
| 412 | return (); | ||
| 413 | } | ||
| 414 | |||
| 415 | =head2 sub set4dragNdrop | ||
| 416 | |||
| 417 | =cut | ||
| 418 | |||
| 419 | sub set4dragNdrop { | ||
| 420 | my ($self) = @_; | ||
| 421 | _reset(); | ||
| 422 | $whereami->{_is_dragNdrop} = $true; | ||
| 423 | |||
| 424 | # print("1. whereami,set4dragNdrop, $whereami->{_is_dragNdrop}\n"); | ||
| 425 | return (); | ||
| 426 | } | ||
| 427 | |||
| 428 | =head2 sub _set_flow_color | ||
| 429 | |||
| 430 | |||
| 431 | =cut | ||
| 432 | |||
| 433 | sub _set_flow_color { | ||
| 434 | my $color = @_; | ||
| 435 | |||
| 436 | if ($color) { | ||
| 437 | |||
| 438 | $whereami->{_flow_color} = $color; | ||
| 439 | |||
| 440 | } | ||
| 441 | else { | ||
| 442 | |||
| 443 | print("whereamin,_set_flow_color, missing color \n "); | ||
| 444 | } | ||
| 445 | |||
| 446 | return (); | ||
| 447 | } | ||
| 448 | |||
| 449 | =head2 sub set4flow_listbox | ||
| 450 | |||
| 451 | TODO: distinguish between listboxes grey,pink,green or blue | ||
| 452 | foreach my $key (sort keys %$whereami) { | ||
| 453 | print (" grey_flow key is $key, value is $whereami->{$key}\n"); | ||
| 454 | } | ||
| 455 | =cut | ||
| 456 | |||
| 457 | sub set4flow_listbox { | ||
| 458 | my ( $self, $color ) = @_; | ||
| 459 | |||
| 460 | # print(" whereami, set4flow_listbox, color: $color\n"); | ||
| 461 | |||
| 462 | if ($color) { | ||
| 463 | _reset(); | ||
| 464 | my $is_flow_listbox_color_w_text = '_is_flow_listbox_' . $color . '_w'; | ||
| 465 | $whereami->{$is_flow_listbox_color_w_text} = $true; | ||
| 466 | $whereami->{_is_flow_listbox_color_w} = $true; | ||
| 467 | $whereami->{_flow_color} = $color; | ||
| 468 | |||
| 469 | # my $out = $whereami->{$is_flow_listbox_color_w_text}; | ||
| 470 | # print("1. whereami,set4flow_listbox, is_flow_listbox_color_w_text: $is_flow_listbox_color_w_text\n"); | ||
| 471 | # print("1. whereami,set4flow_listbox, whereami->{\$is_flow_listbox_color_w_text}: whereami->{$is_flow_listbox_color_w_text}: $out\n"); | ||
| 472 | |||
| 473 | } | ||
| 474 | else { | ||
| 475 | print("whereami,set4flow_listbox, missing color\n"); | ||
| 476 | } | ||
| 477 | |||
| 478 | return (); | ||
| 479 | } | ||
| 480 | |||
| 481 | =head2 sub set4flow_select | ||
| 482 | |||
| 483 | =cut | ||
| 484 | |||
| 485 | sub set4flow_select { | ||
| 486 | my ($self) = @_; | ||
| 487 | _reset(); | ||
| 488 | $whereami->{_is_flow_select_button} = $true; | ||
| 489 | |||
| 490 | # print("1. whereami,set4flow_select, $whereami->{_is_flow_select_button}\n"); | ||
| 491 | return (); | ||
| 492 | } | ||
| 493 | |||
| 494 | =head2 sub set4moveNdrop_in_flow | ||
| 495 | |||
| 496 | =cut | ||
| 497 | |||
| 498 | sub set4moveNdrop_in_flow { | ||
| 499 | my ($self) = @_; | ||
| 500 | _reset(); | ||
| 501 | $whereami->{_is_moveNdrop_in_flow} = $true; | ||
| 502 | |||
| 503 | # print("1. whereami,set4moveNdrop_in_flow, $whereami->{_is_moveNdrop_in_flow}\n"); | ||
| 504 | return (); | ||
| 505 | } | ||
| 506 | |||
| 507 | =head2 sub set4run_button | ||
| 508 | |||
| 509 | =cut | ||
| 510 | |||
| 511 | sub set4run_button { | ||
| 512 | my ($self) = @_; | ||
| 513 | _reset(); | ||
| 514 | $whereami->{_is_run_button} = $true; | ||
| 515 | print("1. whereami,set4run_button, $whereami->{_is_flow_select_button}\n"); | ||
| 516 | return (); | ||
| 517 | } | ||
| 518 | |||
| 519 | =head2 sub set4Save_button | ||
| 520 | |||
| 521 | =cut | ||
| 522 | |||
| 523 | sub set4Save_button { | ||
| 524 | my ($self) = @_; | ||
| 525 | _reset(); | ||
| 526 | $whereami->{_is_Save_button} = $true; | ||
| 527 | print("1. whereami,set4Save_button, $whereami->{_is_Save_button}\n"); | ||
| 528 | return (); | ||
| 529 | } | ||
| 530 | |||
| 531 | =head2 sub set4SaveAs_button | ||
| 532 | |||
| 533 | =cut | ||
| 534 | |||
| 535 | sub set4SaveAs_button { | ||
| 536 | my ($self) = @_; | ||
| 537 | _reset(); | ||
| 538 | $whereami->{_is_SaveAs_button} = $true; | ||
| 539 | print("1. whereami,set4saveAs_button, $whereami->{_is_SaveAs_button}\n"); | ||
| 540 | return (); | ||
| 541 | } | ||
| 542 | |||
| 543 | =head2 sub set4sunix_listbox | ||
| 544 | |||
| 545 | =cut | ||
| 546 | |||
| 547 | sub set4sunix_listbox { | ||
| 548 | my ($self) = @_; | ||
| 549 | |||
| 550 | _reset(); | ||
| 551 | $whereami->{_is_sunix_listbox} = $true; | ||
| 552 | |||
| 553 | #print("1. whereami,set4sunix_listbox, $whereami->{_is_sunix_listbox}\n"); | ||
| 554 | |||
| 555 | return (); | ||
| 556 | } | ||
| 557 | |||
| 558 | =head2 sub set4superflow_select_button | ||
| 559 | |||
| 560 | =cut | ||
| 561 | |||
| 562 | sub set4superflow_select_button { | ||
| 563 | my ($self) = @_; | ||
| 564 | _reset(); | ||
| 565 | $whereami->{_is_superflow_select_button} = $true; | ||
| 566 | |||
| 567 | # print("1. whereami,set4superflow_select_button, $whereami->{_is_superflow_select_button}\n"); | ||
| 568 | return (); | ||
| 569 | } | ||
| 570 | |||
| 571 | =head2 sub widget_type | ||
| 572 | |||
| 573 | # print(" self:$self widget: $widget\n"); | ||
| 574 | my @fields = split (/\./,$widget->PathName()); | ||
| 575 | my $widget_name = $fields[-1]; | ||
| 576 | print ( "whereami, widget_type, widget name is $fields[-1]\n"); | ||
| 577 | print(" reference: $reference\n"); | ||
| 578 | |||
| 579 | |||
| 580 | =cut | ||
| 581 | |||
| 582 | sub widget_type { | ||
| 583 | my ( $self, $widget ) = @_; | ||
| 584 | |||
| 585 | my $type = 'nu'; | ||
| 586 | |||
| 587 | my $reference = $widget->focusCurrent; | ||
| 588 | my @fields = split( '=', $widget->focusCurrent ); | ||
| 589 | |||
| 590 | # foreach my $i (@fields) { | ||
| 591 | # print(" whereami,widget_type is $fields[$i]\n"); | ||
| 592 | # } | ||
| 593 | # print(" 1. whereamin,widget_type widget is $fields[0]\n"); | ||
| 594 | if ( $fields[0] eq 'Tk::Entry' ) { $type = 'Entry' } | ||
| 595 | if ( $fields[0] eq 'MainWindow' ) { $type = 'MainWindow' } | ||
| 596 | if ( $fields[0] eq 'Tk::DragDrop' ) { $type = 'DragDrop' } | ||
| 597 | if ( $fields[0] eq 'Tk::Text' ) { $type = 'Text' } | ||
| 598 | |||
| 599 | return ($type); | ||
| 600 | } | ||
| 601 | |||
| 602 | =head2 sub in_gui | ||
| 603 | |||
| 604 | screen location by using part of the widget name | ||
| 605 | print(" currently focus lies in: $screen_location\n"); | ||
| 606 | print(" 2. widget is $i\n"); | ||
| 607 | my $screen_location = $widget->focusCurrent; | ||
| 608 | my $reference = ref $screen_location; | ||
| 609 | name is in the last element of the split array | ||
| 610 | |||
| 611 | if widget_name= frame then we have flow | ||
| 612 | $var->{_flow} | ||
| 613 | if widget_name= menubutton we have superflow | ||
| 614 | $var->{_tool} | ||
| 615 | |||
| 616 | } | ||
| 617 | |||
| 618 | =cut | ||
| 619 | |||
| 620 | sub in_gui { | ||
| 621 | my ($self) = @_; | ||
| 622 | |||
| 623 | # print ( "widget is $fields[-1]\n"); | ||
| 624 | # | ||
| 625 | |||
| 626 | if ( $whereami->{_is_add2flow_button} ) { | ||
| 627 | |||
| 628 | # print ("whereami,in_gui: _is_add2flow_button\n"); | ||
| 629 | } | ||
| 630 | |||
| 631 | if ( $whereami->{_is_check_code_button} ) { | ||
| 632 | |||
| 633 | # print ("whereami,in_gui:_is_check_code_button \n"); | ||
| 634 | } | ||
| 635 | |||
| 636 | if ( $whereami->{_is_delete_from_flow_button} ) { | ||
| 637 | |||
| 638 | # print ("whereami,in_gui: _is_delete_from_flow_button\n" ); | ||
| 639 | } | ||
| 640 | |||
| 641 | if ( $whereami->{_is_dragNdrop} ) { | ||
| 642 | |||
| 643 | # print ("whereami,in_gui: _is_dragNdrop\n" ); | ||
| 644 | } | ||
| 645 | |||
| 646 | if ( $whereami->{_is_flow_listbox_grey_w} ) { | ||
| 647 | |||
| 648 | # print ("whereami,in_gui: _is_flow_listbox_grey_w\n"); | ||
| 649 | } | ||
| 650 | |||
| 651 | if ( $whereami->{_is_flow_listbox_green_w} ) { | ||
| 652 | |||
| 653 | # print ("whereami,in_gui:_is_flow_listbox_green_w \n"); | ||
| 654 | } | ||
| 655 | |||
| 656 | if ( $whereami->{_is_sunix_listbox} ) { | ||
| 657 | |||
| 658 | # print ("whereami,in_gui: _is_sunix_listbox=$whereami->{_is_sunix_listbox}\n"); | ||
| 659 | } | ||
| 660 | |||
| 661 | if ( $whereami->{_is_sunix_module} ) { | ||
| 662 | |||
| 663 | # print ("whereami,in_gui:_is_sunix_module \n"); | ||
| 664 | } | ||
| 665 | |||
| 666 | if ( $whereami->{_is_run_button} ) { | ||
| 667 | |||
| 668 | # print ("whereami,in_gui:_is_run_button \n"); | ||
| 669 | } | ||
| 670 | |||
| 671 | if ( $whereami->{_is_Save_button} ) { | ||
| 672 | |||
| 673 | # print ("whereami,in_gui:_is_Save_button \n"); | ||
| 674 | } | ||
| 675 | |||
| 676 | if ( $whereami->{_is_SaveAs_button} ) { | ||
| 677 | |||
| 678 | # print ("whereami,in_gui:_is_SaveAs_button \n"); | ||
| 679 | } | ||
| 680 | |||
| 681 | if ( $whereami->{_is_superflow_select_button} ) { | ||
| 682 | |||
| 683 | # print ("whereami,in_gui: _is_superflow_select_button\n"); | ||
| 684 | } | ||
| 685 | |||
| 686 | #print (" \n"); | ||
| 687 | #return($widget_name); | ||
| 688 | return (); | ||
| 689 | } | ||
| 690 | |||
| 691 | 1; |