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