AuswahlBox.cpp 70 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939194019411942194319441945194619471948194919501951195219531954195519561957195819591960196119621963196419651966196719681969197019711972197319741975197619771978197919801981198219831984198519861987198819891990199119921993199419951996199719981999200020012002200320042005200620072008200920102011201220132014201520162017201820192020202120222023202420252026202720282029203020312032203320342035203620372038203920402041204220432044204520462047204820492050205120522053205420552056205720582059206020612062206320642065206620672068206920702071207220732074207520762077207820792080208120822083208420852086208720882089209020912092209320942095209620972098209921002101210221032104210521062107210821092110211121122113211421152116211721182119212021212122212321242125212621272128212921302131213221332134213521362137213821392140214121422143214421452146214721482149215021512152
  1. #include "AuswahlBox.h"
  2. #include "AlphaFeld.h"
  3. #include "Bild.h"
  4. #include "MausEreignis.h"
  5. #include "TastaturEreignis.h"
  6. #include "Rahmen.h"
  7. #include "Scroll.h"
  8. #include "TextFeld.h"
  9. #include "Knopf.h"
  10. #include "Text.h"
  11. #include "Schrift.h"
  12. #include "ToolTip.h"
  13. using namespace Framework;
  14. // Inhalt der AuswahlBox Klasse aus AuswahlBox.h
  15. // Konstruktor
  16. AuswahlBox::AuswahlBox()
  17. : ZeichnungHintergrund(),
  18. textRd( 0 ),
  19. msStyle( 0 ),
  20. members( new RCArray< TextFeld >() ),
  21. ausfahren( new Knopf() ),
  22. auswRahmen( new LRahmen() ),
  23. auswBgF( 0xFF000000 ),
  24. auswBgB( 0 ),
  25. auswAf( new AlphaFeld() ),
  26. msAuswRahmen( 0 ),
  27. msAuswBgF( 0 ),
  28. msAuswBgB( 0 ),
  29. msAuswAf( 0 ),
  30. mausRahmen( new LRahmen() ),
  31. mausBgF( 0xFF000000 ),
  32. mausBgB( 0 ),
  33. mausAf( new AlphaFeld() ),
  34. msMausRahmen( 0 ),
  35. msMausBgF( 0 ),
  36. msMausBgB( 0 ),
  37. msMausAf( 0 ),
  38. anzahl( 0 ),
  39. auswahl( 0 ),
  40. ausgeklappt( 0 ),
  41. ausklappHeight( 0 ),
  42. ausklapMaxHeight( 200 ),
  43. eintragHeight( 15 ),
  44. tickval( 0 ),
  45. mausEintrag( 0 ),
  46. scrollAnzeigen( 0 ),
  47. eAkP( 0 ),
  48. eAk( 0 )
  49. {
  50. vertikalScrollBar = new VScrollBar();
  51. style = Style::Normal;
  52. rahmen = new LRahmen();
  53. rahmen->setFarbe( 0xFFFFFFFF );
  54. rahmen->setRamenBreite( 1 );
  55. ausfahren->setStyle( Knopf::Style::Sichtbar | Knopf::Style::Erlaubt | Knopf::Style::KlickBuffer );
  56. ausfahren->setKBFarbe( 0xA0000000 );
  57. ausfahren->setKBStrength( 10 );
  58. ausfahren->setSize( 18, 18 );
  59. ausfahren->setSchriftFarbe( 0xFFFFFFFF );
  60. ausfahren->setText( "\\/" );
  61. auswRahmen->setFarbe( 0xFF00FF00 );
  62. auswRahmen->setRamenBreite( 1 );
  63. auswAf->setFarbe( 0xA000FF00 );
  64. auswAf->setStrength( 7 );
  65. mausRahmen->setFarbe( 0xFF00FF00 );
  66. mausRahmen->setRamenBreite( 1 );
  67. mausAf->setFarbe( 0x5000FF00 );
  68. mausAf->setStrength( 7 );
  69. gr.x = 20;
  70. gr.y = 20;
  71. }
  72. // Destruktor
  73. AuswahlBox::~AuswahlBox()
  74. {
  75. if( textRd )
  76. textRd->release();
  77. if( msStyle )
  78. msStyle->release();
  79. if( members )
  80. members->release();
  81. if( ausfahren )
  82. ausfahren->release();
  83. if( auswRahmen )
  84. auswRahmen->release();
  85. if( auswBgB )
  86. auswBgB->release();
  87. if( auswAf )
  88. auswAf->release();
  89. if( msAuswRahmen )
  90. msAuswRahmen->release();
  91. if( msAuswAf )
  92. msAuswAf->release();
  93. if( msAuswBgB )
  94. msAuswBgB->release();
  95. if( msAuswBgF )
  96. msAuswBgF->release();
  97. if( mausRahmen )
  98. mausRahmen->release();
  99. if( mausAf )
  100. mausAf->release();
  101. if( mausBgB )
  102. mausBgB->release();
  103. if( msMausRahmen )
  104. msMausRahmen->release();
  105. if( msMausAf )
  106. msMausAf->release();
  107. if( msMausBgB )
  108. msMausBgB->release();
  109. if( msMausBgF )
  110. msMausBgF->release();
  111. }
  112. void AuswahlBox::doMausEreignis( MausEreignis &me, bool userRet ) // Maus
  113. {
  114. if( hatStyleNicht( Style::Erlaubt ) || hatStyleNicht( Style::Fokus ) || me.verarbeitet )
  115. {
  116. ausgeklappt = 0;
  117. me.verarbeitet = 1;
  118. return;
  119. }
  120. if( !userRet )
  121. return;
  122. mausEintrag = -1;
  123. bool insideParent = me.insideParent;
  124. me.insideParent = me.mx >= 0 && me.mx < gr.x &&me.my >= 0 && me.my < gr.y + ausklappHeight;
  125. bool vera = me.verarbeitet;
  126. if( ausfahren )
  127. {
  128. int tmpMx = me.mx;
  129. int tmpMy = me.my;
  130. if( me.mx >= 0 && me.my >= 0 && me.mx < gr.x && me.my < gr.y )
  131. me.mx = ausfahren->getX(), me.my = ausfahren->getY() + 1;
  132. ausfahren->doPublicMausEreignis( me );
  133. me.mx = tmpMx, me.my = tmpMy;
  134. }
  135. if( me.verarbeitet && !vera && me.id == ME_RLinks )
  136. {
  137. ausgeklappt = !ausgeklappt;
  138. if( ausgeklappt )
  139. mausEintrag = auswahl;
  140. if( scrollAnzeigen )
  141. scrollZuEintrag( mausEintrag );
  142. }
  143. if( hatStyle( Style::VScroll ) && vertikalScrollBar && ausgeklappt && scrollAnzeigen )
  144. {
  145. int rbr = 0;
  146. if( rahmen && hatStyle( Style::Rahmen ) )
  147. rbr = rahmen->getRBreite();
  148. if( ( me.mx > gr.x - 15 - rbr && me.my > gr.y ) || me.id == ME_UScroll || me.id == ME_DScroll )
  149. {
  150. vertikalScrollBar->doMausMessage( gr.x - rbr - 15, gr.y, 15, vertikalScrollBar->getScrollData()->anzeige, me );
  151. me.verarbeitet = 1;
  152. }
  153. }
  154. if( !me.verarbeitet )
  155. {
  156. int eintr = -1;
  157. int tmp = me.my - gr.y + ( vertikalScrollBar ? vertikalScrollBar->getScroll() : 0 );
  158. if( hatStyle( Style::MultiStyled ) )
  159. {
  160. for( int i = 0; i < anzahl; ++i )
  161. {
  162. if( tmp > 0 && tmp < ( members->z( i ) ? members->z( i )->getHeight() : 0 ) )
  163. {
  164. eintr = i;
  165. break;
  166. }
  167. tmp -= members->z( i ) ? members->z( i )->getHeight() : 0;
  168. }
  169. }
  170. else
  171. {
  172. for( int i = 0; i < anzahl; ++i )
  173. {
  174. if( tmp > 0 && tmp < eintragHeight )
  175. {
  176. eintr = i;
  177. break;
  178. }
  179. tmp -= eintragHeight;
  180. }
  181. }
  182. if( ausgeklappt && me.mx > 0 && me.mx < gr.x && me.my > gr.y && me.my < gr.y + ausklappHeight )
  183. {
  184. if( eintr >= 0 )
  185. {
  186. if( me.id == ME_RLinks )
  187. {
  188. if( auswahl != eintr )
  189. rend = 1;
  190. auswahl = eintr;
  191. if( eAk )
  192. eAk( eAkP, this, 0, auswahl );
  193. }
  194. if( mausEintrag != eintr )
  195. rend = 1;
  196. mausEintrag = eintr;
  197. }
  198. }
  199. }
  200. me.verarbeitet = 1;
  201. me.insideParent = insideParent;
  202. }
  203. // nicht constant
  204. void AuswahlBox::setEventParam( void *p ) // setzt den Event Parameter
  205. {
  206. eAkP = p;
  207. }
  208. void AuswahlBox::setEventAktion( std::function< void( void *, AuswahlBox *, int, int ) > event ) // setzt die Event Funktion
  209. {
  210. this->eAk = event;
  211. }
  212. void AuswahlBox::setSchriftZ( Schrift *schrift ) // setzt die schrift
  213. {
  214. if( !this->textRd )
  215. textRd = new TextRenderer( schrift );
  216. else
  217. textRd->setSchriftZ( schrift );
  218. ausfahren->setSchriftZ( (Schrift *)schrift->getThis() );
  219. rend = 1;
  220. }
  221. void AuswahlBox::setTextRendererZ( TextRenderer *textRd )
  222. {
  223. if( this->textRd )
  224. this->textRd->release();
  225. this->textRd = textRd;
  226. }
  227. void AuswahlBox::addEintrag( const char *txt ) // Eintrag hinzufügen
  228. {
  229. TextFeld *tf = new TextFeld();
  230. if( textRd )
  231. tf->setSchriftZ( textRd->getSchrift() );
  232. tf->addStyle( TextFeld::Style::Sichtbar | TextFeld::Style::Center | TextFeld::Style::Rahmen );
  233. tf->setText( txt );
  234. tf->setSchriftFarbe( 0xFFFFFFFF );
  235. tf->setRahmenFarbe( 0xFFFFFFFF );
  236. tf->setSize( 0, eintragHeight );
  237. members->add( tf, anzahl );
  238. ++anzahl;
  239. rend = 1;
  240. }
  241. void AuswahlBox::addEintrag( Text *txt )
  242. {
  243. TextFeld *tf = new TextFeld();
  244. if( textRd )
  245. tf->setSchriftZ( textRd->getSchrift() );
  246. tf->addStyle( TextFeld::Style::Sichtbar | TextFeld::Style::Center | TextFeld::Style::Rahmen );
  247. tf->setText( txt );
  248. tf->setSchriftFarbe( 0xFFFFFFFF );
  249. tf->setRahmenFarbe( 0xFFFFFFFF );
  250. tf->setSize( 0, eintragHeight );
  251. members->add( tf, anzahl );
  252. ++anzahl;
  253. rend = 1;
  254. }
  255. void AuswahlBox::addEintragZ( TextFeld *txt )
  256. {
  257. members->add( txt, anzahl );
  258. ++anzahl;
  259. rend = 1;
  260. }
  261. void AuswahlBox::setEintrag( int i, const char *txt ) // Eintrag setzen
  262. {
  263. if( members->z( i ) )
  264. members->z( i )->setText( txt );
  265. rend = 1;
  266. }
  267. void AuswahlBox::setEintrag( int i, Text *txt )
  268. {
  269. if( members->z( i ) )
  270. members->z( i )->setText( txt );
  271. else
  272. txt->release();
  273. rend = 1;
  274. }
  275. void AuswahlBox::setEintragZ( int i, TextFeld *txt )
  276. {
  277. if( i < anzahl )
  278. members->set( txt, i );
  279. else
  280. txt->release();
  281. rend = 1;
  282. }
  283. void AuswahlBox::removeEintrag( int i ) // Eintrag entfernen
  284. {
  285. if( i < anzahl )
  286. {
  287. members->remove( i );
  288. if( msStyle )
  289. msStyle->remove( i );
  290. if( msAuswRahmen )
  291. msAuswRahmen->remove( i );
  292. if( msAuswBgF )
  293. msAuswBgF->remove( i );
  294. if( msAuswBgB )
  295. msAuswBgB->remove( i );
  296. if( msAuswAf )
  297. msAuswAf->remove( i );
  298. if( msMausRahmen )
  299. msMausRahmen->remove( i );
  300. if( msMausBgF )
  301. msMausBgF->remove( i );
  302. if( msMausBgB )
  303. msMausBgB->remove( i );
  304. if( msMausAf )
  305. msMausAf->remove( i );
  306. if( auswahl > i )
  307. --auswahl;
  308. if( mausEintrag > i )
  309. --mausEintrag;
  310. --anzahl;
  311. rend = 1;
  312. }
  313. }
  314. void AuswahlBox::setAusklappKnopfZ( Knopf *ausK ) // Ausklapp Knopf setzen
  315. {
  316. if( ausfahren )
  317. ausfahren->release();
  318. ausfahren = ausK;
  319. rend = 1;
  320. }
  321. void AuswahlBox::setEintragRahmenZ( int i, Rahmen *rahmen ) // Eintrag Rahmen setzen
  322. {
  323. if( members->z( i ) )
  324. members->z( i )->setRahmenZ( rahmen );
  325. else
  326. rahmen->release();
  327. rend = 1;
  328. }
  329. void AuswahlBox::setEintragRahmenFarbe( int i, int f ) // Eintrag Rahmen Farbe setzen
  330. {
  331. if( members->z( i ) )
  332. members->z( i )->setRahmenFarbe( f );
  333. rend = 1;
  334. }
  335. void AuswahlBox::setEintragRahmenBreite( int i, int rbr ) // Eintrag Rahmen Breite setzen
  336. {
  337. if( members->z( i ) )
  338. members->z( i )->setRahmenBreite( rbr );
  339. rend = 1;
  340. }
  341. void AuswahlBox::setEintragHintergrundFarbe( int i, int f ) // Eintrag Hintergrund farbe setzen
  342. {
  343. if( members->z( i ) )
  344. members->z( i )->setHintergrundFarbe( f );
  345. rend = 1;
  346. }
  347. void AuswahlBox::setEintragHintergrundBildZ( int i, Bild *bgB ) // Eintrag Hintergrund Bild setzen
  348. {
  349. if( members->z( i ) )
  350. members->z( i )->setHintergrundBildZ( bgB );
  351. else
  352. bgB->release();
  353. rend = 1;
  354. }
  355. void AuswahlBox::setEintragHintergrundBild( int i, Bild *bgB )
  356. {
  357. if( members->z( i ) )
  358. members->z( i )->setHintergrundBild( bgB );
  359. else
  360. bgB->release();
  361. rend = 1;
  362. }
  363. void AuswahlBox::setEintragAlphaFeldZ( int i, AlphaFeld *af ) // Eintrag AlphaFeld setzen
  364. {
  365. if( members->z( i ) )
  366. members->z( i )->setAlphaFeldZ( af );
  367. rend = 1;
  368. }
  369. void AuswahlBox::setEintragAlphaFeldFarbe( int i, int afF ) // Eintrag AlphaFeld Farbe setzen
  370. {
  371. if( members->z( i ) )
  372. members->z( i )->setAlphaFeldFarbe( afF );
  373. rend = 1;
  374. }
  375. void AuswahlBox::setEintragAlphaFeldStrength( int i, int afSt ) // Eintrag AlphaFeld Stärke setzen
  376. {
  377. if( members->z( i ) )
  378. members->z( i )->setAlphaFeldStrength( afSt );
  379. rend = 1;
  380. }
  381. void AuswahlBox::setAuswRahmenZ( Rahmen *rahmen ) // Auswahl Rahmen setzen
  382. {
  383. if( auswRahmen )
  384. auswRahmen->release();
  385. auswRahmen = rahmen;
  386. rend = 1;
  387. }
  388. void AuswahlBox::setAuswRahmenFarbe( int f ) // Auswahl Rahmen Farbe setzen
  389. {
  390. if( !auswRahmen )
  391. auswRahmen = new LRahmen();
  392. auswRahmen->setFarbe( f );
  393. rend = 1;
  394. }
  395. void AuswahlBox::setAuswRahmenBreite( int rbr ) // Auswahl Rahmen Breite setzen
  396. {
  397. if( !auswRahmen )
  398. auswRahmen = new LRahmen();
  399. auswRahmen->setRamenBreite( rbr );
  400. rend = 1;
  401. }
  402. void AuswahlBox::setAuswHintergrundFarbe( int f ) // Auswahl Hintergrund Farbe setzen
  403. {
  404. auswBgF = f;
  405. rend = 1;
  406. }
  407. void AuswahlBox::setAuswHintergrundBildZ( Bild *bgB ) // Auswahl Hintergrund Bild setzen
  408. {
  409. if( auswBgB )
  410. auswBgB->release();
  411. auswBgB = bgB;
  412. rend = 1;
  413. }
  414. void AuswahlBox::setAuswHintergrundBild( Bild *bgB )
  415. {
  416. if( !auswBgB )
  417. auswBgB = new Bild();
  418. auswBgB->neuBild( bgB->getBreite(), bgB->getHeight(), 0 );
  419. auswBgB->drawBild( 0, 0, bgB->getBreite(), bgB->getHeight(), *bgB );
  420. bgB->release();
  421. rend = 1;
  422. }
  423. void AuswahlBox::setAuswAlphaFeldZ( AlphaFeld *af ) // Auswahl AlphaFeld setzen
  424. {
  425. if( auswAf )
  426. auswAf->release();
  427. auswAf = af;
  428. rend = 1;
  429. }
  430. void AuswahlBox::setAuswAlphaFeldFarbe( int afF ) // Auswahl AlphaFeld Farbe setzen
  431. {
  432. if( !auswAf )
  433. auswAf = new AlphaFeld();
  434. auswAf->setFarbe( afF );
  435. rend = 1;
  436. }
  437. void AuswahlBox::setAuswAlphaFeldStrength( int afSt ) // Auswahl Alpha Feld stärke setzen
  438. {
  439. if( !auswAf )
  440. auswAf = new AlphaFeld();
  441. auswAf->setStrength( afSt );
  442. rend = 1;
  443. }
  444. void AuswahlBox::setMsAuswRahmenZ( int i, Rahmen *rahmen ) // Multistyle Auswahl Rahmen setzen
  445. {
  446. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  447. {
  448. rahmen->release();
  449. return;
  450. }
  451. if( !msAuswRahmen )
  452. msAuswRahmen = new RCArray< Rahmen >();
  453. msAuswRahmen->set( rahmen, i );
  454. rend = 1;
  455. }
  456. void AuswahlBox::setMsAuswRahmenFarbe( int i, int f ) // Multistyle Auswahl Rahmen Farbe setzen
  457. {
  458. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  459. return;
  460. if( !msAuswRahmen )
  461. msAuswRahmen = new RCArray< Rahmen >();
  462. if( !msAuswRahmen->z( i ) )
  463. msAuswRahmen->set( new LRahmen(), i );
  464. msAuswRahmen->z( i )->setFarbe( f );
  465. rend = 1;
  466. }
  467. void AuswahlBox::setMsAuswRahmenBreite( int i, int rbr ) // Multistyle Auswahl Breite setzen
  468. {
  469. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  470. return;
  471. if( !msAuswRahmen )
  472. msAuswRahmen = new RCArray< Rahmen >();
  473. if( !msAuswRahmen->z( i ) )
  474. msAuswRahmen->set( new LRahmen(), i );
  475. msAuswRahmen->z( i )->setRamenBreite( rbr );
  476. rend = 1;
  477. }
  478. void AuswahlBox::setMsAuswHintergrundFarbe( int i, int f ) // Multistyle Auswahl Hintergrund Farbe setzen
  479. {
  480. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  481. return;
  482. if( !msAuswBgF )
  483. msAuswBgF = new Array< int >();
  484. msAuswBgF->set( f, i );
  485. rend = 1;
  486. }
  487. void AuswahlBox::setMsAuswHintergrundBildZ( int i, Bild *bgB ) // Multistyle Auswahl Hintergrund Bild setzen
  488. {
  489. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  490. {
  491. bgB->release();
  492. return;
  493. }
  494. if( !msAuswBgB )
  495. msAuswBgB = new RCArray< Bild >();
  496. msAuswBgB->set( bgB, i );
  497. rend = 1;
  498. }
  499. void AuswahlBox::setMsAuswHintergrundBild( int i, Bild *bgB )
  500. {
  501. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  502. {
  503. bgB->release();
  504. return;
  505. }
  506. if( !msAuswBgB )
  507. msAuswBgB = new RCArray< Bild >();
  508. if( !msAuswBgB->z( i ) )
  509. {
  510. Bild *z = new Bild;
  511. z->neuBild( bgB->getBreite(), bgB->getHeight(), 0 );
  512. z->drawBild( 0, 0, bgB->getBreite(), bgB->getHeight(), *bgB );
  513. msAuswBgB->set( z, i );
  514. }
  515. else
  516. {
  517. msAuswBgB->z( i )->neuBild( bgB->getBreite(), bgB->getHeight(), 0 );
  518. msAuswBgB->z( i )->drawBild( 0, 0, bgB->getBreite(), bgB->getHeight(), *bgB );
  519. }
  520. bgB->release();
  521. rend = 1;
  522. }
  523. void AuswahlBox::setMsAuswAlphaFeldZ( int i, AlphaFeld *af ) // Multistyle Auswahl AlphaFeld setzen
  524. {
  525. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  526. {
  527. af->release();
  528. return;
  529. }
  530. if( !msAuswAf )
  531. msAuswAf = new RCArray< AlphaFeld >();
  532. msAuswAf->set( af, i );
  533. rend = 1;
  534. }
  535. void AuswahlBox::setMsAuswAlphaFeldFarbe( int i, int afF ) // Multistyle Auswahl AlphaFeld Farbe setzen
  536. {
  537. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  538. return;
  539. if( !msAuswAf )
  540. msAuswAf = new RCArray< AlphaFeld >();
  541. if( !msAuswAf->z( i ) )
  542. msAuswAf->set( new AlphaFeld(), i );
  543. msAuswAf->z( i )->setFarbe( afF );
  544. rend = 1;
  545. }
  546. void AuswahlBox::setMsAuswAlphaFeldStrength( int i, int afSt ) // Multistyle Auswahl AlphaFeld stärke setzen
  547. {
  548. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  549. return;
  550. if( !msAuswAf )
  551. msAuswAf = new RCArray< AlphaFeld >();
  552. if( !msAuswAf->z( i ) )
  553. msAuswAf->set( new AlphaFeld(), i );
  554. msAuswAf->z( i )->setStrength( afSt );
  555. rend = 1;
  556. }
  557. void AuswahlBox::setMausRahmenZ( Rahmen *rahmen ) // Maus Rahmen setzen
  558. {
  559. if( mausRahmen )
  560. mausRahmen->release();
  561. mausRahmen = rahmen;
  562. rend = 1;
  563. }
  564. void AuswahlBox::setMausRahmenFarbe( int f ) // Maus Rahmen Farbe setzen
  565. {
  566. if( !mausRahmen )
  567. mausRahmen = new LRahmen();
  568. mausRahmen->setFarbe( f );
  569. rend = 1;
  570. }
  571. void AuswahlBox::setMausRahmenBreite( int rbr ) // Maus Rahmen breite setzen
  572. {
  573. if( !mausRahmen )
  574. mausRahmen = new LRahmen();
  575. mausRahmen->setRamenBreite( rbr );
  576. rend = 1;
  577. }
  578. void AuswahlBox::setMausHintergrundFarbe( int f ) // Maus Hintergrund Farbe setzen
  579. {
  580. mausBgF = f;
  581. rend = 1;
  582. }
  583. void AuswahlBox::setMausHintergrundBildZ( Bild *bgB ) // Maus Hintergrund Bild setzen
  584. {
  585. if( mausBgB )
  586. mausBgB->release();
  587. mausBgB = bgB;
  588. rend = 1;
  589. }
  590. void AuswahlBox::setMausHintergrundBild( Bild *bgB )
  591. {
  592. if( !mausBgB )
  593. mausBgB = new Bild();
  594. mausBgB->neuBild( bgB->getBreite(), bgB->getHeight(), 0 );
  595. mausBgB->drawBild( 0, 0, bgB->getBreite(), bgB->getHeight(), *bgB );
  596. bgB->release();
  597. rend = 1;
  598. }
  599. void AuswahlBox::setMausAlphaFeldZ( AlphaFeld *af ) // Maus AlphaFeld setzen
  600. {
  601. if( mausAf )
  602. mausAf->release();
  603. mausAf = af;
  604. rend = 1;
  605. }
  606. void AuswahlBox::setMausAlphaFeldFarbe( int afF ) // Maus AlphaFeld Farbe setzen
  607. {
  608. if( !mausAf )
  609. mausAf = new AlphaFeld();
  610. mausAf->setFarbe( afF );
  611. rend = 1;
  612. }
  613. void AuswahlBox::setMausAlphaFeldStrength( int afSt ) // Maus AlphaFeld stärke setzen
  614. {
  615. if( !mausAf )
  616. mausAf = new AlphaFeld();
  617. mausAf->setStrength( afSt );
  618. rend = 1;
  619. }
  620. void AuswahlBox::setMsMausRahmenZ( int i, Rahmen *rahmen ) // Multistyle Maus Rahmen setzen
  621. {
  622. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  623. {
  624. rahmen->release();
  625. return;
  626. }
  627. if( !msMausRahmen )
  628. msMausRahmen = new RCArray< Rahmen >();
  629. msMausRahmen->set( rahmen, i );
  630. rend = 1;
  631. }
  632. void AuswahlBox::setMsMausRahmenFarbe( int i, int f ) // Multistyle Maus Rahmen Farbe setzen
  633. {
  634. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  635. return;
  636. if( !msMausRahmen )
  637. msMausRahmen = new RCArray< Rahmen >();
  638. if( !msMausRahmen->z( i ) )
  639. msMausRahmen->set( new LRahmen(), i );
  640. msMausRahmen->z( i )->setFarbe( f );
  641. rend = 1;
  642. }
  643. void AuswahlBox::setMsMausRahmenBreite( int i, int rbr ) // Multistyle Maus Rahmen breite setzen
  644. {
  645. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  646. return;
  647. if( !msMausRahmen )
  648. msMausRahmen = new RCArray< Rahmen >();
  649. if( !msMausRahmen->z( i ) )
  650. msMausRahmen->set( new LRahmen(), i );
  651. msMausRahmen->z( i )->setRamenBreite( rbr );
  652. rend = 1;
  653. }
  654. void AuswahlBox::setMsMausHintergrundFarbe( int i, int f ) // Multistyle Maus Hintergrund Farbe setzen
  655. {
  656. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  657. return;
  658. if( !msMausBgF )
  659. msMausBgF = new Array< int >();
  660. msMausBgF->set( f, i );
  661. rend = 1;
  662. }
  663. void AuswahlBox::setMsMausHintergrundBildZ( int i, Bild *bgB ) // Multistyle Maus Hintergrund Bild setzen
  664. {
  665. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  666. {
  667. bgB->release();
  668. return;
  669. }
  670. if( !msMausBgB )
  671. msMausBgB = new RCArray< Bild >();
  672. msMausBgB->set( bgB, i );
  673. rend = 1;
  674. }
  675. void AuswahlBox::setMsMausHintergrundBild( int i, Bild *bgB )
  676. {
  677. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  678. {
  679. bgB->release();
  680. return;
  681. }
  682. if( !msMausBgB )
  683. msMausBgB = new RCArray< Bild >();
  684. if( !msMausBgB->z( i ) )
  685. {
  686. Bild *z = new Bild;
  687. z->neuBild( bgB->getBreite(), bgB->getHeight(), 0 );
  688. z->drawBild( 0, 0, bgB->getBreite(), bgB->getHeight(), *bgB );
  689. msMausBgB->set( z, i );
  690. }
  691. else
  692. {
  693. msMausBgB->z( i )->neuBild( bgB->getBreite(), bgB->getHeight(), 0 );
  694. msMausBgB->z( i )->drawBild( 0, 0, bgB->getBreite(), bgB->getHeight(), *bgB );
  695. }
  696. bgB->release();
  697. rend = 1;
  698. }
  699. void AuswahlBox::setMsMausAlphaFeldZ( int i, AlphaFeld *af ) // Multistyle Maus AlphaFeld setzen
  700. {
  701. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  702. {
  703. af->release();
  704. return;
  705. }
  706. if( !msMausAf )
  707. msMausAf = new RCArray< AlphaFeld >();
  708. msMausAf->set( af, i );
  709. rend = 1;
  710. }
  711. void AuswahlBox::setMsMausAlphaFeldFarbe( int i, int afF ) // Multistyle Maus AlphaFeld Farbe setzen
  712. {
  713. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  714. return;
  715. if( !msMausAf )
  716. msMausAf = new RCArray< AlphaFeld >();
  717. if( !msMausAf->z( i ) )
  718. msMausAf->set( new AlphaFeld(), i );
  719. msMausAf->z( i )->setFarbe( afF );
  720. rend = 1;
  721. }
  722. void AuswahlBox::setMsMausAlphaFeldStrength( int i, int afSt ) // Multistyle Maus AlphaFeld stärke setzen
  723. {
  724. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  725. return;
  726. if( !msMausAf )
  727. msMausAf = new RCArray< AlphaFeld >();
  728. if( !msMausAf->z( i ) )
  729. msMausAf->set( new AlphaFeld(), i );
  730. msMausAf->z( i )->setStrength( afSt );
  731. rend = 1;
  732. }
  733. void AuswahlBox::setAuswahl( int i ) // Eintrag auswählen
  734. {
  735. if( i < anzahl && i != auswahl )
  736. {
  737. auswahl = i;
  738. if( eAk )
  739. eAk( eAkP, this, 0, auswahl );
  740. rend = 1;
  741. }
  742. }
  743. void AuswahlBox::ausklappen() // liste ausklappen
  744. {
  745. ausgeklappt = 1;
  746. }
  747. void AuswahlBox::einklappen() // liste einklappen
  748. {
  749. ausgeklappt = 0;
  750. }
  751. void AuswahlBox::scrollZuEintrag( int i ) // liste scrollen
  752. {
  753. if( hatStyle( Style::VScroll ) && vertikalScrollBar && i < anzahl )
  754. {
  755. int scrollPos = 0;
  756. if( hatStyle( Style::MultiStyled ) )
  757. {
  758. for( int j = 0; j < i; ++j )
  759. scrollPos += members->z( j ) ? members->z( j )->getHeight() : 0;
  760. }
  761. else
  762. scrollPos += i * eintragHeight;
  763. vertikalScrollBar->scroll( scrollPos );
  764. rend = 1;
  765. }
  766. }
  767. void AuswahlBox::setMaxAuskappHeight( int maxHeight ) // höhe der Liste beim ausklappen
  768. {
  769. ausklapMaxHeight = maxHeight;
  770. }
  771. void AuswahlBox::setEintragHeight( int height ) // setzt die Höhe der Einträge
  772. {
  773. eintragHeight = height;
  774. }
  775. void AuswahlBox::addMsStyle( int i, __int64 abStyle ) // Multistyle style hinzufügen
  776. {
  777. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  778. return;
  779. if( !msStyle )
  780. msStyle = new Array< __int64 >();
  781. msStyle->set( msStyle->get( i ) | abStyle, i );
  782. rend = 1;
  783. }
  784. void AuswahlBox::setMsStyle( int i, __int64 abStyle, bool add ) // Multistyle style setzen
  785. {
  786. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  787. return;
  788. if( !msStyle )
  789. msStyle = new Array< __int64 >();
  790. if( add )
  791. msStyle->set( msStyle->get( i ) | abStyle, i );
  792. else
  793. msStyle->set( msStyle->get( i ) & ~abStyle, i );
  794. rend = 1;
  795. }
  796. void AuswahlBox::setMsStyle( int i, __int64 abStyle )
  797. {
  798. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  799. return;
  800. if( !msStyle )
  801. msStyle = new Array< __int64 >();
  802. msStyle->set( abStyle, i );
  803. rend = 1;
  804. }
  805. void AuswahlBox::removeMsStyle( int i, __int64 abStyle ) // Multistyle style entfernen
  806. {
  807. if( hatStyleNicht( Style::MultiStyled ) || i >= anzahl )
  808. return;
  809. if( !msStyle )
  810. msStyle = new Array< __int64 >();
  811. msStyle->set( msStyle->get( i ) & ~abStyle, i );
  812. rend = 1;
  813. }
  814. bool AuswahlBox::tick( double tickVal ) // tick
  815. {
  816. if( ausgeklappt && ausfahren && !ausfahren->zText()->istGleich( "/\\" ) )
  817. {
  818. ausfahren->setText( "/\\" );
  819. rend = 1;
  820. }
  821. else if( !ausgeklappt && ausfahren && !ausfahren->zText()->istGleich( "\\/" ) )
  822. {
  823. ausfahren->setText( "\\/" );
  824. rend = 1;
  825. }
  826. if( hatStyleNicht( Style::Sichtbar ) || hatStyleNicht( Style::Erlaubt ) )
  827. ausgeklappt = 0;
  828. rend |= ausfahren->tick( tickVal );
  829. this->tickval += tickVal * 300;
  830. int val = (int)this->tickval;
  831. if( val < 1 )
  832. return ZeichnungHintergrund::tick( tickVal );
  833. this->tickval -= val;
  834. int maxHeight = rahmen ? rahmen->getRBreite() : 0;
  835. if( hatStyleNicht( Style::MultiStyled ) )
  836. maxHeight += anzahl * eintragHeight;
  837. else
  838. for( int i = 0; i < anzahl; ++i )
  839. maxHeight += members->z( i ) ? members->z( i )->getHeight() : 0;
  840. if( maxHeight > ausklapMaxHeight )
  841. {
  842. if( hatStyle( Style::VScroll ) && vertikalScrollBar )
  843. {
  844. scrollAnzeigen = 1;
  845. vertikalScrollBar->update( maxHeight, ausklapMaxHeight );
  846. }
  847. maxHeight = ausklapMaxHeight;
  848. }
  849. else
  850. scrollAnzeigen = 0;
  851. if( ausgeklappt )
  852. {
  853. if( ausklappHeight < maxHeight )
  854. {
  855. ausklappHeight += val;
  856. if( ausklappHeight > maxHeight )
  857. ausklappHeight = maxHeight;
  858. rend = 1;
  859. }
  860. }
  861. else
  862. {
  863. if( ausklappHeight > 0 )
  864. {
  865. ausklappHeight -= val;
  866. if( ausklappHeight < 0 )
  867. ausklappHeight = 0;
  868. rend = 1;
  869. }
  870. }
  871. for( int i = 0; i < anzahl; ++i )
  872. {
  873. if( i != auswahl )
  874. rend |= members->z( i )->tick( tickVal );
  875. else
  876. members->z( i )->tick( tickVal );
  877. }
  878. return ZeichnungHintergrund::tick( tickVal );
  879. }
  880. void AuswahlBox::doTastaturEreignis( TastaturEreignis &te ) // Tastatur
  881. {
  882. if( te.verarbeitet || hatStyleNicht( Style::Fokus ) || hatStyleNicht( Style::Erlaubt ) )
  883. return;
  884. if( te.id == TE_Release )
  885. {
  886. switch( te.taste )
  887. {
  888. case T_Oben:
  889. if( auswahl > 0 )
  890. --auswahl;
  891. else
  892. auswahl = anzahl - 1;
  893. if( eAk )
  894. eAk( eAkP, this, 0, auswahl );
  895. scrollZuEintrag( auswahl );
  896. rend = 1;
  897. break;
  898. case T_Unten:
  899. if( auswahl < anzahl - 1 )
  900. ++auswahl;
  901. else
  902. auswahl = 0;
  903. if( eAk )
  904. eAk( eAkP, this, 0, auswahl );
  905. scrollZuEintrag( auswahl );
  906. rend = 1;
  907. break;
  908. }
  909. }
  910. if( te.verarbeitet && nTak )
  911. te.verarbeitet = nTak( ntakParam, this, te );
  912. }
  913. void AuswahlBox::render( Bild &zRObj ) // zeichnet nach zRObj
  914. {
  915. if( hatStyle( Style::Sichtbar ) )
  916. {
  917. lockZeichnung();
  918. int br = gr.x;
  919. int hi = gr.y + ausklappHeight;
  920. if( ( ausklappHeight && !zRObj.setDrawOptionsErzwingen( pos.x, pos.y, br, hi ) ) || ( !ausklappHeight && !zRObj.setDrawOptions( pos.x, pos.y, br, hi ) ) )
  921. {
  922. unlockZeichnung();
  923. return;
  924. }
  925. int rbr = 0;
  926. if( hatStyle( Style::Rahmen ) && rahmen ) // Rahmen zeichnen
  927. {
  928. rahmen->setSize( br, hi );
  929. rahmen->render( zRObj );
  930. rbr = rahmen->getRBreite();
  931. }
  932. if( ( ausklappHeight && !zRObj.setDrawOptionsErzwingen( rbr, rbr, br - rbr * 2, hi - rbr * 2 ) ) || ( !ausklappHeight && !zRObj.setDrawOptions( rbr, rbr, br - rbr * 2, hi - rbr * 2 ) ) )
  933. {
  934. zRObj.releaseDrawOptions();
  935. unlockZeichnung();
  936. return;
  937. }
  938. if( hatStyle( Style::Hintergrund ) )
  939. {
  940. if( hatStyle( Style::HAlpha ) )
  941. zRObj.alphaRegion( 0, 0, br, hi, hintergrundFarbe );
  942. else
  943. zRObj.fillRegion( 0, 0, br, hi, hintergrundFarbe );
  944. if( hatStyle( Style::HBild ) && hintergrundBild )
  945. {
  946. if( hatStyle( Style::HAlpha ) )
  947. zRObj.alphaBild( 0, 0, br, hi, *hintergrundBild );
  948. else
  949. zRObj.drawBild( 0, 0, br, hi, *hintergrundBild );
  950. }
  951. }
  952. if( hatStyle( Style::Buffered ) && hintergrundFeld )
  953. {
  954. hintergrundFeld->setSize( br - rbr * 2, hi - rbr * 2 );
  955. hintergrundFeld->render( zRObj );
  956. }
  957. if( ausfahren ) // Ausklapp Knopf zeichnen
  958. {
  959. ausfahren->setSize( gr.y - rbr * 2, gr.y - rbr * 2 );
  960. ausfahren->setPosition( gr.x - rbr - ausfahren->getBreite(), rbr );
  961. ausfahren->render( zRObj );
  962. }
  963. if( members ) // Ausgewähtes TextFeld zeichnen
  964. {
  965. if( auswahl < 0 )
  966. {
  967. auswahl = 0;
  968. if( eAk )
  969. eAk( eAkP, this, 0, auswahl );
  970. }
  971. if( auswahl >= anzahl )
  972. {
  973. auswahl = anzahl - 1;
  974. if( eAk )
  975. eAk( eAkP, this, 0, auswahl );
  976. }
  977. TextFeld *tf = auswahl >= 0 ? members->z( auswahl ) : 0;
  978. if( tf )
  979. {
  980. AlphaFeld *tmpBuffer = 0;
  981. bool tmpB = 0;
  982. int tmpHFarbe = 0;
  983. bool tmpH = 0;
  984. Bild *tmpHBild = 0;
  985. bool tmpHB = 0;
  986. bool tmpHAlpha = 0;
  987. Rahmen *tmpRahmen = 0;
  988. bool tmpR = 0;
  989. if( hatStyleNicht( Style::MultiStyled ) || !msStyle )
  990. {
  991. if( hatStyle( Style::AuswahlBuffer ) )
  992. {
  993. tmpBuffer = tf->getAlphaFeld();
  994. tf->setAlphaFeldZ( (AlphaFeld *)auswAf->getThis() );
  995. tmpB = tf->hatStyle( TextFeld::Style::Buffered );
  996. tf->setStyle( TextFeld::Style::Buffered, hatStyle( Style::AuswahlBuffer ) );
  997. }
  998. if( hatStyle( Style::AuswahlHintergrund ) )
  999. {
  1000. tmpH = tf->hatStyle( TextFeld::Style::Hintergrund );
  1001. tmpHFarbe = tf->getHintergrundFarbe();
  1002. tf->setHintergrundFarbe( auswBgF );
  1003. tf->setStyle( TextFeld::Style::Hintergrund, hatStyle( Style::Hintergrund ) );
  1004. if( hatStyle( Style::AuswahlHBild ) )
  1005. {
  1006. tmpHBild = tf->getHintergrundBild();
  1007. tf->setHintergrundBildZ( (Bild *)auswBgB->getThis() );
  1008. tmpHB = tf->hatStyle( TextFeld::Style::HBild );
  1009. tf->setStyle( TextFeld::Style::HBild, hatStyle( Style::HBild ) );
  1010. }
  1011. if( hatStyle( Style::AuswahlHAlpha ) )
  1012. {
  1013. tmpHAlpha = tf->hatStyle( TextFeld::Style::HAlpha );
  1014. tf->setStyle( TextFeld::Style::HAlpha, hatStyle( Style::AuswahlHAlpha ) );
  1015. }
  1016. }
  1017. if( hatStyle( Style::AuswahlRahmen ) )
  1018. {
  1019. tmpRahmen = tf->getRahmen();
  1020. tf->setRahmenZ( (Rahmen *)auswRahmen->getThis() );
  1021. tmpR = tf->hatStyle( TextFeld::Style::Rahmen );
  1022. tf->setStyle( TextFeld::Style::Rahmen, hatStyle( Style::AuswahlRahmen ) );
  1023. }
  1024. }
  1025. else
  1026. {
  1027. if( hatMsStyle( auswahl, Style::AuswahlBuffer ) && msAuswAf )
  1028. {
  1029. tmpBuffer = tf->getAlphaFeld();
  1030. tf->setAlphaFeldZ( msAuswAf->get( auswahl ) );
  1031. tmpB = tf->hatStyle( TextFeld::Style::Buffered );
  1032. tf->setStyle( TextFeld::Style::Buffered, hatMsStyle( auswahl, Style::AuswahlBuffer ) );
  1033. }
  1034. if( hatMsStyle( auswahl, Style::AuswahlHintergrund ) )
  1035. {
  1036. tmpH = tf->hatStyle( Style::Hintergrund );
  1037. tf->setStyle( TextFeld::Style::Hintergrund, hatMsStyle( auswahl, Style::AuswahlHintergrund ) );
  1038. if( msAuswBgF && msAuswBgF->hat( auswahl ) )
  1039. {
  1040. tmpHFarbe = tf->getHintergrundFarbe();
  1041. tf->setHintergrundFarbe( msAuswBgF->get( auswahl ) );
  1042. }
  1043. if( hatMsStyle( auswahl, Style::AuswahlHBild ) && msAuswBgB )
  1044. {
  1045. tmpHBild = tf->getHintergrundBild();
  1046. tf->setHintergrundBildZ( msAuswBgB->get( auswahl ) );
  1047. tmpHB = tf->hatStyle( TextFeld::Style::HBild );
  1048. tf->setStyle( TextFeld::Style::HBild, hatMsStyle( auswahl, Style::HBild ) );
  1049. }
  1050. if( hatMsStyle( auswahl, Style::AuswahlHAlpha ) )
  1051. {
  1052. tmpHAlpha = tf->hatStyle( TextFeld::Style::HAlpha );
  1053. tf->setStyle( TextFeld::Style::HAlpha, hatMsStyle( auswahl, Style::AuswahlHAlpha ) );
  1054. }
  1055. }
  1056. if( hatMsStyle( auswahl, Style::AuswahlRahmen ) && msAuswRahmen )
  1057. {
  1058. tmpRahmen = tf->getRahmen();
  1059. tf->setRahmenZ( msAuswRahmen->get( auswahl ) );
  1060. tmpR = tf->hatStyle( TextFeld::Style::Rahmen );
  1061. tf->setStyle( TextFeld::Style::Rahmen, hatMsStyle( auswahl, Style::AuswahlRahmen ) );
  1062. }
  1063. }
  1064. int tmpHi = tf->getHeight();
  1065. tf->setPosition( 0, 0 );
  1066. tf->setSize( gr.x - rbr * 2 - ( ausfahren ? ausfahren->getBreite() : 0 ), gr.y - rbr * 2 );
  1067. tf->render( zRObj );
  1068. tf->setSize( tf->getBreite(), tmpHi );
  1069. if( hatStyleNicht( Style::MultiStyled ) || !msStyle )
  1070. {
  1071. if( hatStyle( Style::AuswahlBuffer ) )
  1072. {
  1073. tf->setAlphaFeldZ( tmpBuffer );
  1074. tf->setStyle( TextFeld::Style::Buffered, tmpB );
  1075. }
  1076. if( hatStyle( Style::AuswahlHintergrund ) )
  1077. {
  1078. tf->setHintergrundFarbe( tmpHFarbe );
  1079. tf->setStyle( TextFeld::Style::Hintergrund, tmpH );
  1080. if( hatStyle( Style::AuswahlHBild ) )
  1081. {
  1082. tf->setHintergrundBildZ( tmpHBild );
  1083. tf->setStyle( TextFeld::Style::HBild, tmpHB );
  1084. }
  1085. if( hatStyle( Style::AuswahlHAlpha ) )
  1086. tf->setStyle( TextFeld::Style::HAlpha, tmpHAlpha );
  1087. }
  1088. if( hatStyle( Style::AuswahlRahmen ) )
  1089. {
  1090. tf->setRahmenZ( tmpRahmen );
  1091. tf->setStyle( TextFeld::Style::Rahmen, tmpR );
  1092. }
  1093. }
  1094. else
  1095. {
  1096. if( hatMsStyle( auswahl, Style::AuswahlBuffer ) && msAuswAf )
  1097. {
  1098. tf->setAlphaFeldZ( tmpBuffer );
  1099. tf->setStyle( TextFeld::Style::Buffered, tmpB );
  1100. }
  1101. if( hatMsStyle( auswahl, Style::AuswahlHintergrund ) )
  1102. {
  1103. tf->setStyle( TextFeld::Style::Hintergrund, tmpH );
  1104. if( msAuswBgF && msAuswBgF->hat( auswahl ) )
  1105. tf->setHintergrundFarbe( tmpHFarbe );
  1106. if( hatMsStyle( auswahl, Style::AuswahlHBild ) && msAuswBgB )
  1107. {
  1108. tf->setHintergrundBildZ( tmpHBild );
  1109. tf->setStyle( TextFeld::Style::HBild, tmpHB );
  1110. }
  1111. if( hatMsStyle( auswahl, Style::AuswahlHAlpha ) )
  1112. tf->setStyle( TextFeld::Style::HAlpha, tmpHAlpha );
  1113. }
  1114. if( hatMsStyle( auswahl, Style::AuswahlRahmen ) && msAuswRahmen )
  1115. {
  1116. tf->setRahmenZ( tmpRahmen );
  1117. tf->setStyle( TextFeld::Style::Rahmen, tmpR );
  1118. }
  1119. }
  1120. }
  1121. }
  1122. bool vsb = hatStyle( Style::VScroll ) && vertikalScrollBar; // Scroll bar zeichnen
  1123. if( auswahl >= anzahl )
  1124. {
  1125. auswahl = 0;
  1126. if( eAk )
  1127. eAk( eAkP, this, 0, auswahl );
  1128. }
  1129. if( members )
  1130. {
  1131. if( vsb && ausklappHeight )
  1132. {
  1133. br -= 15;
  1134. vertikalScrollBar->getScrollData()->anzeige = ausklappHeight - rbr;
  1135. vertikalScrollBar->render( br - rbr, gr.y, 15, ausklappHeight - rbr, zRObj );
  1136. }
  1137. if( ( ausklappHeight && !zRObj.setDrawOptionsErzwingen( 0, gr.y, br - rbr, hi - rbr - gr.y ) ) || ( !ausklappHeight && !zRObj.setDrawOptions( 0, gr.y, br - rbr, hi - rbr - gr.y ) ) )
  1138. {
  1139. zRObj.releaseDrawOptions();
  1140. zRObj.releaseDrawOptions();
  1141. unlockZeichnung();
  1142. return;
  1143. }
  1144. int maxHeight = 0;
  1145. int dy = 0;
  1146. if( vsb )
  1147. dy -= vertikalScrollBar->getScroll();
  1148. int mdy = hi - rbr;
  1149. anzahl = members->getEintragAnzahl();
  1150. for( int i = 0; i < anzahl; ++i )
  1151. {
  1152. TextFeld *tf = members->z( i );
  1153. if( dy >= mdy && !vsb )
  1154. break;
  1155. tf->setPosition( 0, dy );
  1156. tf->setSize( br - rbr * 2, tf->getHeight() );
  1157. maxHeight += tf->getHeight();
  1158. bool selected = auswahl == i;
  1159. AlphaFeld *tmpBuffer = 0;
  1160. bool tmpB = 0;
  1161. int tmpHFarbe = 0;
  1162. bool tmpH = 0;
  1163. Bild *tmpHBild = 0;
  1164. bool tmpHB = 0;
  1165. bool tmpHAlpha = 0;
  1166. Rahmen *tmpRahmen = 0;
  1167. bool tmpR = 0;
  1168. if( selected )
  1169. {
  1170. if( hatStyleNicht( Style::MultiStyled ) || !msStyle )
  1171. {
  1172. if( hatStyle( Style::AuswahlBuffer ) )
  1173. {
  1174. tmpBuffer = tf->getAlphaFeld();
  1175. tf->setAlphaFeldZ( (AlphaFeld *)auswAf->getThis() );
  1176. tmpB = tf->hatStyle( TextFeld::Style::Buffered );
  1177. tf->setStyle( TextFeld::Style::Buffered, hatStyle( Style::AuswahlBuffer ) );
  1178. }
  1179. if( hatStyle( Style::AuswahlHintergrund ) )
  1180. {
  1181. tmpH = tf->hatStyle( TextFeld::Style::Hintergrund );
  1182. tmpHFarbe = tf->getHintergrundFarbe();
  1183. tf->setHintergrundFarbe( auswBgF );
  1184. tf->setStyle( TextFeld::Style::Hintergrund, hatStyle( Style::Hintergrund ) );
  1185. if( hatStyle( Style::AuswahlHBild ) )
  1186. {
  1187. tmpHBild = tf->getHintergrundBild();
  1188. tf->setHintergrundBildZ( (Bild *)auswBgB->getThis() );
  1189. tmpHB = tf->hatStyle( TextFeld::Style::HBild );
  1190. tf->setStyle( TextFeld::Style::HBild, hatStyle( Style::HBild ) );
  1191. }
  1192. if( hatStyle( Style::AuswahlHAlpha ) )
  1193. {
  1194. tmpHAlpha = tf->hatStyle( TextFeld::Style::HAlpha );
  1195. tf->setStyle( TextFeld::Style::HAlpha, hatStyle( Style::AuswahlHAlpha ) );
  1196. }
  1197. }
  1198. if( hatStyle( Style::AuswahlRahmen ) )
  1199. {
  1200. tmpRahmen = tf->getRahmen();
  1201. tf->setRahmenZ( (Rahmen *)auswRahmen->getThis() );
  1202. tmpR = tf->hatStyle( TextFeld::Style::Rahmen );
  1203. tf->setStyle( TextFeld::Style::Rahmen, hatStyle( Style::AuswahlRahmen ) );
  1204. }
  1205. }
  1206. else
  1207. {
  1208. if( hatMsStyle( i, Style::AuswahlBuffer ) && msAuswAf )
  1209. {
  1210. tmpBuffer = tf->getAlphaFeld();
  1211. tf->setAlphaFeldZ( msAuswAf->get( i ) );
  1212. tmpB = tf->hatStyle( TextFeld::Style::Buffered );
  1213. tf->setStyle( TextFeld::Style::Buffered, hatMsStyle( i, Style::AuswahlBuffer ) );
  1214. }
  1215. if( hatMsStyle( i, Style::AuswahlHintergrund ) )
  1216. {
  1217. tmpH = tf->hatStyle( Style::Hintergrund );
  1218. tf->setStyle( TextFeld::Style::Hintergrund, hatMsStyle( i, Style::AuswahlHintergrund ) );
  1219. if( msAuswBgF && msAuswBgF->hat( i ) )
  1220. {
  1221. tmpHFarbe = tf->getHintergrundFarbe();
  1222. tf->setHintergrundFarbe( msAuswBgF->get( i ) );
  1223. }
  1224. if( hatMsStyle( i, Style::AuswahlHBild ) && msAuswBgB )
  1225. {
  1226. tmpHBild = tf->getHintergrundBild();
  1227. tf->setHintergrundBildZ( msAuswBgB->get( i ) );
  1228. tmpHB = tf->hatStyle( TextFeld::Style::HBild );
  1229. tf->setStyle( TextFeld::Style::HBild, hatMsStyle( i, Style::HBild ) );
  1230. }
  1231. if( hatMsStyle( i, Style::AuswahlHAlpha ) )
  1232. {
  1233. tmpHAlpha = tf->hatStyle( TextFeld::Style::HAlpha );
  1234. tf->setStyle( TextFeld::Style::HAlpha, hatMsStyle( i, Style::AuswahlHAlpha ) );
  1235. }
  1236. }
  1237. if( hatMsStyle( i, Style::AuswahlRahmen ) && msAuswRahmen )
  1238. {
  1239. tmpRahmen = tf->getRahmen();
  1240. tf->setRahmenZ( msAuswRahmen->get( i ) );
  1241. tmpR = tf->hatStyle( TextFeld::Style::Rahmen );
  1242. tf->setStyle( TextFeld::Style::Rahmen, hatMsStyle( i, Style::AuswahlRahmen ) );
  1243. }
  1244. }
  1245. }
  1246. else if( mausEintrag == i )
  1247. {
  1248. if( hatStyleNicht( Style::MultiStyled ) || !msStyle )
  1249. {
  1250. if( hatStyle( Style::MausBuffer ) )
  1251. {
  1252. tmpBuffer = tf->getAlphaFeld();
  1253. tf->setAlphaFeldZ( (AlphaFeld *)mausAf->getThis() );
  1254. tmpB = tf->hatStyle( TextFeld::Style::Buffered );
  1255. tf->setStyle( TextFeld::Style::Buffered, hatStyle( Style::MausBuffer ) );
  1256. }
  1257. if( hatStyle( Style::MausHintergrund ) )
  1258. {
  1259. tmpH = tf->hatStyle( TextFeld::Style::Hintergrund );
  1260. tmpHFarbe = tf->getHintergrundFarbe();
  1261. tf->setHintergrundFarbe( mausBgF );
  1262. tf->setStyle( TextFeld::Style::Hintergrund, hatStyle( Style::Hintergrund ) );
  1263. if( hatStyle( Style::MausHBild ) )
  1264. {
  1265. tmpHBild = tf->getHintergrundBild();
  1266. tf->setHintergrundBildZ( (Bild *)mausBgB->getThis() );
  1267. tmpHB = tf->hatStyle( TextFeld::Style::HBild );
  1268. tf->setStyle( TextFeld::Style::HBild, hatStyle( Style::HBild ) );
  1269. }
  1270. if( hatStyle( Style::MausHAlpha ) )
  1271. {
  1272. tmpHAlpha = tf->hatStyle( TextFeld::Style::HAlpha );
  1273. tf->setStyle( TextFeld::Style::HAlpha, hatStyle( Style::MausHAlpha ) );
  1274. }
  1275. }
  1276. if( hatStyle( Style::MausRahmen ) )
  1277. {
  1278. tmpRahmen = tf->getRahmen();
  1279. tf->setRahmenZ( (Rahmen *)mausRahmen->getThis() );
  1280. tmpR = tf->hatStyle( TextFeld::Style::Rahmen );
  1281. tf->setStyle( TextFeld::Style::Rahmen, hatStyle( Style::MausRahmen ) );
  1282. }
  1283. }
  1284. else
  1285. {
  1286. if( hatMsStyle( i, Style::MausBuffer ) && msAuswAf )
  1287. {
  1288. tmpBuffer = tf->getAlphaFeld();
  1289. tf->setAlphaFeldZ( msMausAf->get( i ) );
  1290. tmpB = tf->hatStyle( TextFeld::Style::Buffered );
  1291. tf->setStyle( TextFeld::Style::Buffered, hatMsStyle( i, Style::MausBuffer ) );
  1292. }
  1293. if( hatMsStyle( i, Style::MausHintergrund ) )
  1294. {
  1295. tmpH = tf->hatStyle( Style::Hintergrund );
  1296. tf->setStyle( TextFeld::Style::Hintergrund, hatMsStyle( i, Style::MausHintergrund ) );
  1297. if( msMausBgF && msMausBgF->hat( i ) )
  1298. {
  1299. tmpHFarbe = tf->getHintergrundFarbe();
  1300. tf->setHintergrundFarbe( msMausBgF->get( i ) );
  1301. }
  1302. if( hatMsStyle( i, Style::MausHBild ) && msMausBgB )
  1303. {
  1304. tmpHBild = tf->getHintergrundBild();
  1305. tf->setHintergrundBildZ( msMausBgB->get( i ) );
  1306. tmpHB = tf->hatStyle( TextFeld::Style::HBild );
  1307. tf->setStyle( TextFeld::Style::HBild, hatMsStyle( i, Style::HBild ) );
  1308. }
  1309. if( hatMsStyle( i, Style::MausHAlpha ) )
  1310. {
  1311. tmpHAlpha = tf->hatStyle( TextFeld::Style::HAlpha );
  1312. tf->setStyle( TextFeld::Style::HAlpha, hatMsStyle( i, Style::MausHAlpha ) );
  1313. }
  1314. }
  1315. if( hatMsStyle( i, Style::MausRahmen ) && msMausRahmen )
  1316. {
  1317. tmpRahmen = tf->getRahmen();
  1318. tf->setRahmenZ( msMausRahmen->get( i ) );
  1319. tmpR = tf->hatStyle( TextFeld::Style::Rahmen );
  1320. tf->setStyle( TextFeld::Style::Rahmen, hatMsStyle( i, Style::MausRahmen ) );
  1321. }
  1322. }
  1323. }
  1324. tf->render( zRObj );
  1325. if( selected )
  1326. {
  1327. if( hatStyleNicht( Style::MultiStyled ) || !msStyle )
  1328. {
  1329. if( hatStyle( Style::AuswahlBuffer ) )
  1330. {
  1331. tf->setAlphaFeldZ( tmpBuffer );
  1332. tf->setStyle( TextFeld::Style::Buffered, tmpB );
  1333. }
  1334. if( hatStyle( Style::AuswahlHintergrund ) )
  1335. {
  1336. tf->setHintergrundFarbe( tmpHFarbe );
  1337. tf->setStyle( TextFeld::Style::Hintergrund, tmpH );
  1338. if( hatStyle( Style::AuswahlHBild ) )
  1339. {
  1340. tf->setHintergrundBildZ( tmpHBild );
  1341. tf->setStyle( TextFeld::Style::HBild, tmpHB );
  1342. }
  1343. if( hatStyle( Style::AuswahlHAlpha ) )
  1344. tf->setStyle( TextFeld::Style::HAlpha, tmpHAlpha );
  1345. }
  1346. if( hatStyle( Style::AuswahlRahmen ) )
  1347. {
  1348. tf->setRahmenZ( tmpRahmen );
  1349. tf->setStyle( TextFeld::Style::Rahmen, tmpR );
  1350. }
  1351. }
  1352. else
  1353. {
  1354. if( hatMsStyle( i, Style::AuswahlBuffer ) && msAuswAf )
  1355. {
  1356. tf->setAlphaFeldZ( tmpBuffer );
  1357. tf->setStyle( TextFeld::Style::Buffered, tmpB );
  1358. }
  1359. if( hatMsStyle( i, Style::AuswahlHintergrund ) )
  1360. {
  1361. tf->setStyle( TextFeld::Style::Hintergrund, tmpH );
  1362. if( msAuswBgF && msAuswBgF->hat( i ) )
  1363. tf->setHintergrundFarbe( tmpHFarbe );
  1364. if( hatMsStyle( i, Style::AuswahlHBild ) && msAuswBgB )
  1365. {
  1366. tf->setHintergrundBildZ( tmpHBild );
  1367. tf->setStyle( TextFeld::Style::HBild, tmpHB );
  1368. }
  1369. if( hatMsStyle( i, Style::AuswahlHAlpha ) )
  1370. tf->setStyle( TextFeld::Style::HAlpha, tmpHAlpha );
  1371. }
  1372. if( hatMsStyle( i, Style::AuswahlRahmen ) && msAuswRahmen )
  1373. {
  1374. tf->setRahmenZ( tmpRahmen );
  1375. tf->setStyle( TextFeld::Style::Rahmen, tmpR );
  1376. }
  1377. }
  1378. }
  1379. else if( mausEintrag == i )
  1380. {
  1381. if( hatStyleNicht( Style::MultiStyled ) || !msStyle )
  1382. {
  1383. if( hatStyle( Style::MausBuffer ) )
  1384. {
  1385. tf->setAlphaFeldZ( tmpBuffer );
  1386. tf->setStyle( TextFeld::Style::Buffered, tmpB );
  1387. }
  1388. if( hatStyle( Style::MausHintergrund ) )
  1389. {
  1390. tf->setHintergrundFarbe( tmpHFarbe );
  1391. tf->setStyle( TextFeld::Style::Hintergrund, tmpH );
  1392. if( hatStyle( Style::MausHBild ) )
  1393. {
  1394. tf->setHintergrundBildZ( tmpHBild );
  1395. tf->setStyle( TextFeld::Style::HBild, tmpHB );
  1396. }
  1397. if( hatStyle( Style::MausHAlpha ) )
  1398. tf->setStyle( TextFeld::Style::HAlpha, tmpHAlpha );
  1399. }
  1400. if( hatStyle( Style::MausRahmen ) )
  1401. {
  1402. tf->setRahmenZ( tmpRahmen );
  1403. tf->setStyle( TextFeld::Style::Rahmen, tmpR );
  1404. }
  1405. }
  1406. else
  1407. {
  1408. if( hatMsStyle( i, Style::MausBuffer ) && msAuswAf )
  1409. {
  1410. tf->setAlphaFeldZ( tmpBuffer );
  1411. tf->setStyle( TextFeld::Style::Buffered, tmpB );
  1412. }
  1413. if( hatMsStyle( i, Style::MausHintergrund ) )
  1414. {
  1415. tf->setStyle( TextFeld::Style::Hintergrund, tmpH );
  1416. if( msAuswBgF && msAuswBgF->hat( i ) )
  1417. tf->setHintergrundFarbe( tmpHFarbe );
  1418. if( hatMsStyle( i, Style::MausHBild ) && msAuswBgB )
  1419. {
  1420. tf->setHintergrundBildZ( tmpHBild );
  1421. tf->setStyle( TextFeld::Style::HBild, tmpHB );
  1422. }
  1423. if( hatMsStyle( i, Style::MausHAlpha ) )
  1424. tf->setStyle( TextFeld::Style::HAlpha, tmpHAlpha );
  1425. }
  1426. if( hatMsStyle( i, Style::MausRahmen ) && msAuswRahmen )
  1427. {
  1428. tf->setRahmenZ( tmpRahmen );
  1429. tf->setStyle( TextFeld::Style::Rahmen, tmpR );
  1430. }
  1431. }
  1432. }
  1433. dy += tf->getHeight();
  1434. }
  1435. if( vertikalScrollBar )
  1436. vertikalScrollBar->getScrollData()->max = maxHeight;
  1437. zRObj.releaseDrawOptions();
  1438. }
  1439. zRObj.releaseDrawOptions();
  1440. zRObj.releaseDrawOptions();
  1441. unlockZeichnung();
  1442. }
  1443. }
  1444. // constant
  1445. int AuswahlBox::getEintragPos( const char *txt ) const // gibt die Eintrag Position zurück
  1446. {
  1447. for( int i = 0; i < anzahl; ++i )
  1448. if( members->z( i ) && members->z( i )->zText()->istGleich( txt ) )
  1449. return i;
  1450. return -1;
  1451. }
  1452. int AuswahlBox::getEintragPos( Text *txt ) const
  1453. {
  1454. for( int i = 0; i < anzahl; ++i )
  1455. {
  1456. if( members->z( i ) && members->z( i )->zText()->istGleich( txt->getText() ) )
  1457. {
  1458. txt->release();
  1459. return i;
  1460. }
  1461. }
  1462. txt->release();
  1463. return -1;
  1464. }
  1465. Text *AuswahlBox::getEintragText( int i ) const // gibt den Eintrag Text zurück
  1466. {
  1467. if( i >= anzahl )
  1468. return 0;
  1469. return members->z( i ) ? members->z( i )->getText() : 0;
  1470. }
  1471. Text *AuswahlBox::zEintragText( int i ) const
  1472. {
  1473. if( i >= anzahl )
  1474. return 0;
  1475. return members->z( i ) ? members->z( i )->zText() : 0;
  1476. }
  1477. TextFeld *AuswahlBox::getEintrag( int i ) const // gibt den Eintrag zurück
  1478. {
  1479. if( i >= anzahl )
  1480. return 0;
  1481. return members->get( i );
  1482. }
  1483. TextFeld *AuswahlBox::zEintrag( int i ) const
  1484. {
  1485. if( i >= anzahl )
  1486. return 0;
  1487. return members->z( i );
  1488. }
  1489. int AuswahlBox::getAuswahl() const // gibt die Position des ausgewählten Eintrages zurück
  1490. {
  1491. return auswahl;
  1492. }
  1493. int AuswahlBox::getEintragAnzahl() const // gibt die Anzahl der Einträge zurück
  1494. {
  1495. return anzahl;
  1496. }
  1497. bool AuswahlBox::istAusgeklappt() const // prüft, ob die Liste ausgeklappt ist
  1498. {
  1499. return ausgeklappt;
  1500. }
  1501. int AuswahlBox::getMaxHeight() const // gibt die maximale Höhe der Liste zurück
  1502. {
  1503. if( !hatStyle( Style::MaxHeight ) )
  1504. return 0;
  1505. return ausklapMaxHeight;
  1506. }
  1507. int AuswahlBox::getEintragHeight() const // gibt die Höhe der Einträge zurück
  1508. {
  1509. return eintragHeight;
  1510. }
  1511. Knopf *AuswahlBox::getAusklappKnopf() const // gibt den aus-/einklapp Knopf zurück
  1512. {
  1513. if( hatStyle( Style::MultiStyled ) )
  1514. return 0;
  1515. return ausfahren ? (Knopf *)ausfahren->getThis() : 0;
  1516. }
  1517. Knopf *AuswahlBox::zAusklappKnopf() const
  1518. {
  1519. if( hatStyle( Style::MultiStyled ) )
  1520. return 0;
  1521. return ausfahren;
  1522. }
  1523. Rahmen *AuswahlBox::getEintragRahmen( int i ) const // gibt den Eintrag Rahmen zurück
  1524. {
  1525. if( !hatStyle( Style::MultiStyled ) )
  1526. return 0;
  1527. if( !members->z( i ) )
  1528. return 0;
  1529. return members->z( i )->getRahmen();
  1530. }
  1531. Rahmen *AuswahlBox::zEintragRahmen( int i ) const
  1532. {
  1533. if( !hatStyle( Style::MultiStyled ) )
  1534. return 0;
  1535. if( !members->z( i ) )
  1536. return 0;
  1537. return members->z( i )->zRahmen();
  1538. }
  1539. int AuswahlBox::getEintragRahmenFarbe( int i ) const // gibt die Eintrag Rahmen Frabe zurück
  1540. {
  1541. if( !hatStyle( Style::MultiStyled ) )
  1542. return 0;
  1543. if( !members->z( i ) )
  1544. return 0;
  1545. return members->z( i )->getRahmenFarbe();
  1546. }
  1547. int AuswahlBox::getEintragRahmenBreite( int i ) const // gibt die Eintrag Rahmen Breite zurück
  1548. {
  1549. if( !hatStyle( Style::MultiStyled ) )
  1550. return 0;
  1551. if( !members->z( i ) )
  1552. return 0;
  1553. return members->z( i )->getRahmenBreite();
  1554. }
  1555. AlphaFeld *AuswahlBox::getEintragAlphaFeld( int i ) const // gibt das Eintrag AlphaFeld zurück
  1556. {
  1557. if( !hatStyle( Style::MultiStyled ) )
  1558. return 0;
  1559. if( !members->z( i ) )
  1560. return 0;
  1561. return members->z( i )->getAlphaFeld();
  1562. }
  1563. AlphaFeld *AuswahlBox::zEintragAlphaFeld( int i ) const
  1564. {
  1565. if( !hatStyle( Style::MultiStyled ) )
  1566. return 0;
  1567. if( !members->z( i ) )
  1568. return 0;
  1569. return members->z( i )->zAlphaFeld();
  1570. }
  1571. int AuswahlBox::getEintragAlphaFeldFarbe( int i ) const // gibt die Eintrag AlphaFeld Farbe zurück
  1572. {
  1573. if( !hatStyle( Style::MultiStyled ) )
  1574. return 0;
  1575. if( !members->z( i ) )
  1576. return 0;
  1577. return members->z( i )->getAlphaFeldFarbe();
  1578. }
  1579. int AuswahlBox::getEintragAlphaFeldStrength( int i ) const // gibt die Eintrag AlphaFeld stärke zurück
  1580. {
  1581. if( !hatStyle( Style::MultiStyled ) )
  1582. return 0;
  1583. if( !members->z( i ) )
  1584. return 0;
  1585. return members->z( i )->getAlphaFeldStrength();
  1586. }
  1587. int AuswahlBox::getEintragHintergrundFarbe( int i ) const // gibt die Eintrag Hintergrund Farbe zurück
  1588. {
  1589. if( !hatStyle( Style::MultiStyled ) )
  1590. return 0;
  1591. if( !members->z( i ) )
  1592. return 0;
  1593. return members->z( i )->getHintergrundFarbe();
  1594. }
  1595. Bild *AuswahlBox::getEintragHintergrundBild( int i ) const // gibt das Eintrag Hintergrund Bild zurück
  1596. {
  1597. if( !hatStyle( Style::MultiStyled ) )
  1598. return 0;
  1599. if( !members->z( i ) )
  1600. return 0;
  1601. return members->z( i )->getHintergrundBild();
  1602. }
  1603. Bild *AuswahlBox::zEintragHintergrundBild( int i ) const
  1604. {
  1605. if( !hatStyle( Style::MultiStyled ) )
  1606. return 0;
  1607. if( !members->z( i ) )
  1608. return 0;
  1609. return members->z( i )->zHintergrundBild();
  1610. }
  1611. Rahmen *AuswahlBox::getAuswRahmen() const // gibt den Auswahl Rahmen zurück
  1612. {
  1613. if( hatStyle( Style::MultiStyled ) )
  1614. return 0;
  1615. return auswRahmen ? (Rahmen *)auswRahmen->getThis() : 0;
  1616. }
  1617. Rahmen *AuswahlBox::zAuswRahmen() const
  1618. {
  1619. if( hatStyle( Style::MultiStyled ) )
  1620. return 0;
  1621. return auswRahmen;
  1622. }
  1623. int AuswahlBox::getAuswRahmenFarbe() const // gibt die Auswahl Rahmen Frabe zurück
  1624. {
  1625. if( hatStyle( Style::MultiStyled ) )
  1626. return 0;
  1627. return auswRahmen ? auswRahmen->getFarbe() : 0;
  1628. }
  1629. int AuswahlBox::getAuswRahmenBreite() const // gibt die Auswahl Rahmen Breite zurück
  1630. {
  1631. if( hatStyle( Style::MultiStyled ) )
  1632. return 0;
  1633. return auswRahmen ? auswRahmen->getRBreite() : 0;
  1634. }
  1635. AlphaFeld *AuswahlBox::getAuswAlphaFeld() const // gibt das Auswahl AlphaFeld zurück
  1636. {
  1637. if( hatStyle( Style::MultiStyled ) )
  1638. return 0;
  1639. return auswAf ? (AlphaFeld *)auswAf->getThis() : 0;
  1640. }
  1641. AlphaFeld *AuswahlBox::zAuswAlphaFeld() const
  1642. {
  1643. if( hatStyle( Style::MultiStyled ) )
  1644. return 0;
  1645. return auswAf;
  1646. }
  1647. int AuswahlBox::getAuswAlphaFeldFarbe() const // gibt die Auswahl AlphaFeld Farbe zurück
  1648. {
  1649. if( hatStyle( Style::MultiStyled ) )
  1650. return 0;
  1651. return auswAf ? auswAf->getFarbe() : 0;
  1652. }
  1653. int AuswahlBox::getAuswAlphaFeldStrength() const // gibt die Auswahl AlphaFeld stärke zurück
  1654. {
  1655. if( hatStyle( Style::MultiStyled ) )
  1656. return 0;
  1657. return auswAf ? auswAf->getStrength() : 0;
  1658. }
  1659. int AuswahlBox::getAuswHintergrundFarbe() const // gibt die Auswahl Hintergrund Farbe zurück
  1660. {
  1661. if( hatStyle( Style::MultiStyled ) )
  1662. return 0;
  1663. return auswBgF;
  1664. }
  1665. Bild *AuswahlBox::getAuswHintergrundBild() const // gibt das Auswahl Hintergrund Bild zurück
  1666. {
  1667. if( hatStyle( Style::MultiStyled ) )
  1668. return 0;
  1669. return auswBgB ? (Bild *)auswBgB->getThis() : 0;
  1670. }
  1671. Bild *AuswahlBox::zAuswHintergrundBild() const
  1672. {
  1673. if( hatStyle( Style::MultiStyled ) )
  1674. return 0;
  1675. return auswBgB;
  1676. }
  1677. Rahmen *AuswahlBox::getMsAuswRahmen( int i ) const // gibt den Multistyle Auswahl Rahmen zurück
  1678. {
  1679. if( !hatStyle( Style::MultiStyled ) )
  1680. return 0;
  1681. if( !msAuswRahmen )
  1682. return 0;
  1683. return msAuswRahmen->z( i ) ? (Rahmen *)msAuswRahmen->z( i )->getThis() : 0;
  1684. }
  1685. Rahmen *AuswahlBox::zMsAuswRahmen( int i ) const
  1686. {
  1687. if( !hatStyle( Style::MultiStyled ) )
  1688. return 0;
  1689. if( !msAuswRahmen )
  1690. return 0;
  1691. return msAuswRahmen->z( i );
  1692. }
  1693. int AuswahlBox::getMsAuswRahmenFarbe( int i ) const // gibt die Multistyle Auswahl Rahmen Frabe zurück
  1694. {
  1695. if( !hatStyle( Style::MultiStyled ) )
  1696. return 0;
  1697. if( !msAuswRahmen )
  1698. return 0;
  1699. return msAuswRahmen->z( i ) ? msAuswRahmen->z( i )->getFarbe() : 0;
  1700. }
  1701. int AuswahlBox::getMsAuswRahmenBreite( int i ) const // gibt die Multistyle Auswahl Rahmen Breite zurück
  1702. {
  1703. if( !hatStyle( Style::MultiStyled ) )
  1704. return 0;
  1705. if( !msAuswRahmen )
  1706. return 0;
  1707. return msAuswRahmen->z( i ) ? msAuswRahmen->z( i )->getRBreite() : 0;
  1708. }
  1709. AlphaFeld *AuswahlBox::getMsAuswAlphaFeld( int i ) const // gibt das Multistyle Auswahl AlphaFeld zurück
  1710. {
  1711. if( !hatStyle( Style::MultiStyled ) )
  1712. return 0;
  1713. if( !msAuswAf )
  1714. return 0;
  1715. return msAuswAf->z( i ) ? (AlphaFeld *)msAuswAf->z( i )->getThis() : 0;
  1716. }
  1717. AlphaFeld *AuswahlBox::zMsAuswAlphaFeld( int i ) const
  1718. {
  1719. if( !hatStyle( Style::MultiStyled ) )
  1720. return 0;
  1721. if( !msAuswAf )
  1722. return 0;
  1723. return msAuswAf->z( i );
  1724. }
  1725. int AuswahlBox::getMsAuswAlphaFeldFarbe( int i ) const // gibt die Multistyle Auswahl AlphaFeld Farbe zurück
  1726. {
  1727. if( !hatStyle( Style::MultiStyled ) )
  1728. return 0;
  1729. if( !msAuswAf )
  1730. return 0;
  1731. return msAuswAf->z( i ) ? msAuswAf->z( i )->getFarbe() : 0;
  1732. }
  1733. int AuswahlBox::getMsAuswAlphaFeldStrength( int i ) const // gibt die Multistyle Auswahl AlphaFeld stärke zurück
  1734. {
  1735. if( !hatStyle( Style::MultiStyled ) )
  1736. return 0;
  1737. if( !msAuswAf )
  1738. return 0;
  1739. return msAuswAf->z( i ) ? msAuswAf->z( i )->getStrength() : 0;
  1740. }
  1741. int AuswahlBox::getMsAuswHintergrundFarbe( int i ) const // gibt die Multistyle Auswahl Hintergrund Farbe zurück
  1742. {
  1743. if( !hatStyle( Style::MultiStyled ) )
  1744. return 0;
  1745. if( !msAuswBgF || !msAuswBgF->hat( i ) )
  1746. return 0;
  1747. return msAuswBgF->get( i );
  1748. }
  1749. Bild *AuswahlBox::getMsAuswHintergrundBild( int i ) const // gibt das Multistyle Auswahl Hintergrund Bild zurück
  1750. {
  1751. if( !hatStyle( Style::MultiStyled ) )
  1752. return 0;
  1753. if( !msAuswBgB )
  1754. return 0;
  1755. return msAuswBgB->get( i );
  1756. }
  1757. Bild *AuswahlBox::zMsAuswHintergrundBild( int i ) const
  1758. {
  1759. if( !hatStyle( Style::MultiStyled ) )
  1760. return 0;
  1761. if( !msAuswBgB )
  1762. return 0;
  1763. return msAuswBgB->z( i );
  1764. }
  1765. Rahmen *AuswahlBox::getMausRahmen() const // gibt den Maus Rahmen zurück
  1766. {
  1767. if( hatStyle( Style::MultiStyled ) )
  1768. return 0;
  1769. return mausRahmen ? (Rahmen *)mausRahmen->getThis() : 0;
  1770. }
  1771. Rahmen *AuswahlBox::zMausRahmen() const
  1772. {
  1773. if( hatStyle( Style::MultiStyled ) )
  1774. return 0;
  1775. return mausRahmen;
  1776. }
  1777. int AuswahlBox::getMausRahmenFarbe() const // gibt die Maus Rahmen Frabe zurück
  1778. {
  1779. if( hatStyle( Style::MultiStyled ) )
  1780. return 0;
  1781. return mausRahmen ? mausRahmen->getFarbe() : 0;
  1782. }
  1783. int AuswahlBox::getMausRahmenBreite() const // gibt die Maus Rahmen Breite zurück
  1784. {
  1785. if( hatStyle( Style::MultiStyled ) )
  1786. return 0;
  1787. return mausRahmen ? mausRahmen->getRBreite() : 0;
  1788. }
  1789. AlphaFeld *AuswahlBox::getMausAlphaFeld() const // gibt das Maus AlphaFeld zurück
  1790. {
  1791. if( hatStyle( Style::MultiStyled ) )
  1792. return 0;
  1793. return mausAf ? (AlphaFeld *)mausAf->getThis() : 0;
  1794. }
  1795. AlphaFeld *AuswahlBox::zMausAlphaFeld() const
  1796. {
  1797. if( hatStyle( Style::MultiStyled ) )
  1798. return 0;
  1799. return mausAf;
  1800. }
  1801. int AuswahlBox::getMausAlphaFeldFarbe() const // gibt die Maus AlphaFeld Farbe zurück
  1802. {
  1803. if( hatStyle( Style::MultiStyled ) )
  1804. return 0;
  1805. return mausAf ? mausAf->getFarbe() : 0;
  1806. }
  1807. int AuswahlBox::getMausAlphaFeldStrength() const // gibt die Maus AlphaFeld stärke zurück
  1808. {
  1809. if( hatStyle( Style::MultiStyled ) )
  1810. return 0;
  1811. return mausAf ? mausAf->getStrength() : 0;
  1812. }
  1813. int AuswahlBox::getMausHintergrundFarbe() const // gibt die Maus Hintergrund Farbe zurück
  1814. {
  1815. if( hatStyle( Style::MultiStyled ) )
  1816. return 0;
  1817. return mausBgF;
  1818. }
  1819. Bild *AuswahlBox::getMausHintergrundBild() const // gibt das Maus Hintergrund Bild zurück
  1820. {
  1821. if( hatStyle( Style::MultiStyled ) )
  1822. return 0;
  1823. return mausBgB ? (Bild *)mausBgB->getThis() : 0;
  1824. }
  1825. Bild *AuswahlBox::zMausHintergrundBild() const
  1826. {
  1827. if( hatStyle( Style::MultiStyled ) )
  1828. return 0;
  1829. return mausBgB;
  1830. }
  1831. Rahmen *AuswahlBox::getMsMausRahmen( int i ) const // gibt den Multistyle Maus Rahmen zurück
  1832. {
  1833. if( !hatStyle( Style::MultiStyled ) )
  1834. return 0;
  1835. if( !msMausRahmen )
  1836. return 0;
  1837. return msMausRahmen->get( i );
  1838. }
  1839. Rahmen *AuswahlBox::zMsMausRahmen( int i ) const
  1840. {
  1841. if( !hatStyle( Style::MultiStyled ) )
  1842. return 0;
  1843. if( !msMausRahmen )
  1844. return 0;
  1845. return msMausRahmen->z( i );
  1846. }
  1847. int AuswahlBox::getMsMausRahmenFarbe( int i ) const // gibt die Multistyle Maus Rahmen Frabe zurück
  1848. {
  1849. if( !hatStyle( Style::MultiStyled ) )
  1850. return 0;
  1851. if( !msMausRahmen )
  1852. return 0;
  1853. return msMausRahmen->z( i ) ? msMausRahmen->z( i )->getFarbe() : 0;
  1854. }
  1855. int AuswahlBox::getMsMausRahmenBreite( int i ) const // gibt die Multistyle Maus Rahmen Breite zurück
  1856. {
  1857. if( !hatStyle( Style::MultiStyled ) )
  1858. return 0;
  1859. if( !msMausRahmen )
  1860. return 0;
  1861. return msMausRahmen->z( i ) ? msMausRahmen->z( i )->getRBreite() : 0;
  1862. }
  1863. AlphaFeld *AuswahlBox::getMsMausAlphaFeld( int i ) const // gibt das Multistyle Maus AlphaFeld zurück
  1864. {
  1865. if( !hatStyle( Style::MultiStyled ) )
  1866. return 0;
  1867. if( !msMausAf )
  1868. return 0;
  1869. return msMausAf->get( i );
  1870. }
  1871. AlphaFeld *AuswahlBox::zMsMausAlphaFeld( int i ) const
  1872. {
  1873. if( !hatStyle( Style::MultiStyled ) )
  1874. return 0;
  1875. if( !msMausAf )
  1876. return 0;
  1877. return msMausAf->z( i );
  1878. }
  1879. int AuswahlBox::getMsMausAlphaFeldFarbe( int i ) const // gibt die Multistyle Maus AlphaFeld Farbe zurück
  1880. {
  1881. if( !hatStyle( Style::MultiStyled ) )
  1882. return 0;
  1883. if( !msMausAf )
  1884. return 0;
  1885. return msMausAf->z( i ) ? msMausAf->z( i )->getFarbe() : 0;
  1886. }
  1887. int AuswahlBox::getMsMausAlphaFeldStrength( int i ) const // gibt die Multistyle Maus AlphaFeld stärke zurück
  1888. {
  1889. if( !hatStyle( Style::MultiStyled ) )
  1890. return 0;
  1891. if( !msMausAf )
  1892. return 0;
  1893. return msMausAf->z( i ) ? msMausAf->z( i )->getStrength() : 0;
  1894. }
  1895. int AuswahlBox::getMsMausHintergrundFarbe( int i ) const // gibt die Multistyle Maus Hintergrund Farbe zurück
  1896. {
  1897. if( !hatStyle( Style::MultiStyled ) )
  1898. return 0;
  1899. if( !msMausBgF || !msMausBgF->hat( i ) )
  1900. return 0;
  1901. return msMausBgF->get( i );
  1902. }
  1903. Bild *AuswahlBox::getMsMausHintergrundBild( int i ) const // gibt das Multistyle Maus Hintergrund Bild zurück
  1904. {
  1905. if( !hatStyle( Style::MultiStyled ) )
  1906. return 0;
  1907. if( !msMausBgB )
  1908. return 0;
  1909. return msMausBgB->get( i );
  1910. }
  1911. Bild *AuswahlBox::zMsMausHintergrundBild( int i ) const
  1912. {
  1913. if( !hatStyle( Style::MultiStyled ) )
  1914. return 0;
  1915. if( !msMausBgB )
  1916. return 0;
  1917. return msMausBgB->z( i );
  1918. }
  1919. // Prüft, ob ein Punkt in diesem Objekt liegt
  1920. // x: die x koordinate des punktes
  1921. // y: die y koordinate des punktes
  1922. // return: 1, wenn der punkt innen ist, 0 sonst
  1923. bool AuswahlBox::istPunktInnen( int x, int y ) const
  1924. {
  1925. return x >= pos.x && x < pos.x + gr.x && y >= pos.y && y < pos.y + gr.y + ausklappHeight;
  1926. }
  1927. bool AuswahlBox::hatMsStyle( int i, __int64 abStyle ) const // prüft ob Multistyle style vorhanden
  1928. {
  1929. if( ( style | Style::MultiStyled ) != style || !msStyle || !msStyle->hat( i ) )
  1930. return 0;
  1931. return ( msStyle->get( i ) | abStyle ) == msStyle->get( i );
  1932. }
  1933. bool AuswahlBox::hatMsStyleNicht( int i, __int64 abStyle ) const // prüft ob Multistyle style nicht vorhanden
  1934. {
  1935. if( ( style | Style::MultiStyled ) != style || !msStyle || !msStyle->hat( i ) )
  1936. return 1;
  1937. return ( msStyle->get( i ) | abStyle ) != msStyle->get( i );
  1938. }
  1939. Zeichnung *AuswahlBox::dublizieren() const // Erzeugt eine Kopie des Zeichnungs
  1940. {
  1941. AuswahlBox *obj = new AuswahlBox();
  1942. obj->setPosition( pos );
  1943. obj->setSize( gr );
  1944. obj->setMausEreignisParameter( makParam );
  1945. obj->setTastaturEreignisParameter( takParam );
  1946. obj->setMausEreignis( mak );
  1947. obj->setTastaturEreignis( tak );
  1948. if( toolTip )
  1949. obj->setToolTipZ( (ToolTip *)toolTip->dublizieren() );
  1950. obj->setStyle( style );
  1951. if( textRd )
  1952. obj->setTextRendererZ( (TextRenderer *)textRd->getThis() );
  1953. if( rahmen )
  1954. obj->setRahmenZ( (Rahmen *)rahmen->dublizieren() );
  1955. if( ausfahren )
  1956. obj->setAusklappKnopfZ( (Knopf *)ausfahren->dublizieren() );
  1957. obj->setHintergrundFarbe( hintergrundFarbe );
  1958. if( hintergrundBild )
  1959. obj->setHintergrundBild( (Bild *)hintergrundBild->getThis() );
  1960. if( hintergrundFeld )
  1961. obj->setAlphaFeldZ( (AlphaFeld *)hintergrundFeld->dublizieren() );
  1962. if( auswRahmen )
  1963. obj->setAuswRahmenZ( (Rahmen *)auswRahmen->dublizieren() );
  1964. obj->setAuswHintergrundFarbe( auswBgF );
  1965. if( auswBgB )
  1966. obj->setAuswHintergrundBild( (Bild *)auswBgB->getThis() );
  1967. if( auswAf )
  1968. obj->setAuswAlphaFeldZ( (AlphaFeld *)auswAf->dublizieren() );
  1969. if( mausRahmen )
  1970. obj->setMausRahmenZ( (Rahmen *)mausRahmen->dublizieren() );
  1971. obj->setMausHintergrundFarbe( mausBgF );
  1972. if( mausBgB )
  1973. obj->setMausHintergrundBild( (Bild *)mausBgB->getThis() );
  1974. if( mausAf )
  1975. obj->setMausAlphaFeldZ( (AlphaFeld *)mausAf->dublizieren() );
  1976. obj->setMaxAuskappHeight( ausklapMaxHeight );
  1977. obj->setEintragHeight( eintragHeight );
  1978. for( int i = 0; i < anzahl; ++i )
  1979. {
  1980. if( members->z( i ) )
  1981. {
  1982. obj->addEintrag( "a" );
  1983. obj->setEintragZ( i, (TextFeld *)members->z( i )->dublizieren() );
  1984. if( msStyle && msStyle->hat( i ) )
  1985. obj->setMsStyle( i, msStyle->get( i ) );
  1986. if( msAuswRahmen && msAuswRahmen->z( i ) )
  1987. obj->setMsAuswRahmenZ( i, (Rahmen *)msAuswRahmen->z( i )->dublizieren() );
  1988. if( msAuswBgF && msAuswBgF->hat( i ) )
  1989. obj->setMsAuswHintergrundFarbe( i, msAuswBgF->get( i ) );
  1990. if( msAuswBgB && msAuswBgB->z( i ) )
  1991. obj->setMsAuswHintergrundBild( i, msAuswBgB->get( i ) );
  1992. if( msAuswAf && msAuswAf->z( i ) )
  1993. obj->setMsAuswAlphaFeldZ( i, (AlphaFeld *)msAuswAf->z( i )->dublizieren() );
  1994. if( msMausRahmen && msMausRahmen->z( i ) )
  1995. obj->setMsMausRahmenZ( i, (Rahmen *)msMausRahmen->z( i )->dublizieren() );
  1996. if( msMausBgF && msMausBgF->hat( i ) )
  1997. obj->setMsMausHintergrundFarbe( i, msMausBgF->get( i ) );
  1998. if( msMausBgB && msMausBgB->z( i ) )
  1999. obj->setMsMausHintergrundBild( i, msMausBgB->get( i ) );
  2000. if( msMausAf && msMausAf->z( i ) )
  2001. obj->setMsMausAlphaFeldZ( i, (AlphaFeld *)msMausAf->z( i )->dublizieren() );
  2002. }
  2003. }
  2004. obj->setAlphaFeldFarbe( auswahl );
  2005. return obj;
  2006. }