Mercurial > wow > hansgar_and_franzok_assist
comparison Libs/DF/panel.lua @ 26:e16b1fc13935
- framework update.
| author | Tercio |
|---|---|
| date | Fri, 16 Oct 2015 14:46:27 -0300 |
| parents | dbd417f413a8 |
| children | 5da06cb420d4 |
comparison
equal
deleted
inserted
replaced
| 25:6bb668a41455 | 26:e16b1fc13935 |
|---|---|
| 1472 | 1472 |
| 1473 local SimplePanel_frame_backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true} | 1473 local SimplePanel_frame_backdrop = {edgeFile = [[Interface\Buttons\WHITE8X8]], edgeSize = 1, bgFile = [[Interface\Tooltips\UI-Tooltip-Background]], tileSize = 64, tile = true} |
| 1474 local SimplePanel_frame_backdrop_color = {0, 0, 0, 0.9} | 1474 local SimplePanel_frame_backdrop_color = {0, 0, 0, 0.9} |
| 1475 local SimplePanel_frame_backdrop_border_color = {0, 0, 0, 1} | 1475 local SimplePanel_frame_backdrop_border_color = {0, 0, 0, 1} |
| 1476 | 1476 |
| 1477 function DF:CreateSimplePanel (parent, w, h, title, name) | 1477 local no_options = {} |
| 1478 function DF:CreateSimplePanel (parent, w, h, title, name, panel_options) | |
| 1478 | 1479 |
| 1479 if (not name) then | 1480 if (not name) then |
| 1480 name = "DetailsFrameworkSimplePanel" .. simple_panel_counter | 1481 name = "DetailsFrameworkSimplePanel" .. simple_panel_counter |
| 1481 simple_panel_counter = simple_panel_counter + 1 | 1482 simple_panel_counter = simple_panel_counter + 1 |
| 1482 end | 1483 end |
| 1483 if (not parent) then | 1484 if (not parent) then |
| 1484 parent = UIParent | 1485 parent = UIParent |
| 1485 end | 1486 end |
| 1487 | |
| 1488 panel_options = panel_options or no_options | |
| 1486 | 1489 |
| 1487 local f = CreateFrame ("frame", name, UIParent) | 1490 local f = CreateFrame ("frame", name, UIParent) |
| 1488 f:SetSize (w or 400, h or 250) | 1491 f:SetSize (w or 400, h or 250) |
| 1489 f:SetPoint ("center", UIParent, "center", 0, 0) | 1492 f:SetPoint ("center", UIParent, "center", 0, 0) |
| 1490 f:SetFrameStrata ("FULLSCREEN") | 1493 f:SetFrameStrata ("FULLSCREEN") |
| 1491 f:EnableMouse() | 1494 f:EnableMouse() |
| 1492 f:SetMovable (true) | 1495 f:SetMovable (true) |
| 1493 f:SetBackdrop (SimplePanel_frame_backdrop) | 1496 f:SetBackdrop (SimplePanel_frame_backdrop) |
| 1494 f:SetBackdropColor (unpack (SimplePanel_frame_backdrop_color)) | 1497 f:SetBackdropColor (unpack (SimplePanel_frame_backdrop_color)) |
| 1495 f:SetBackdropBorderColor (unpack (SimplePanel_frame_backdrop_border_color)) | 1498 f:SetBackdropBorderColor (unpack (SimplePanel_frame_backdrop_border_color)) |
| 1496 tinsert (UISpecialFrames, name) | 1499 |
| 1500 f.DontRightClickClose = panel_options.DontRightClickClose | |
| 1501 | |
| 1502 if (not panel_options.NoTUISpecialFrame) then | |
| 1503 tinsert (UISpecialFrames, name) | |
| 1504 end | |
| 1497 | 1505 |
| 1498 local title_bar = CreateFrame ("frame", name .. "TitleBar", f) | 1506 local title_bar = CreateFrame ("frame", name .. "TitleBar", f) |
| 1499 title_bar:SetPoint ("topleft", f, "topleft", 2, -3) | 1507 title_bar:SetPoint ("topleft", f, "topleft", 2, -3) |
| 1500 title_bar:SetPoint ("topright", f, "topright", -2, -3) | 1508 title_bar:SetPoint ("topright", f, "topright", -2, -3) |
| 1501 title_bar:SetHeight (20) | 1509 title_bar:SetHeight (20) |
| 1502 title_bar:SetBackdrop (SimplePanel_frame_backdrop) | 1510 title_bar:SetBackdrop (SimplePanel_frame_backdrop) |
| 1503 title_bar:SetBackdropColor (.2, .2, .2, 1) | 1511 title_bar:SetBackdropColor (.2, .2, .2, 1) |
| 1504 title_bar:SetBackdropBorderColor (0, 0, 0, 1) | 1512 title_bar:SetBackdropBorderColor (0, 0, 0, 1) |
| 1513 f.TitleBar = title_bar | |
| 1505 | 1514 |
| 1506 local close = CreateFrame ("button", name and name .. "CloseButton", title_bar) | 1515 local close = CreateFrame ("button", name and name .. "CloseButton", title_bar) |
| 1507 close:SetSize (16, 16) | 1516 close:SetSize (16, 16) |
| 1508 close:SetNormalTexture (DF.folder .. "icons") | 1517 close:SetNormalTexture (DF.folder .. "icons") |
| 1509 close:SetHighlightTexture (DF.folder .. "icons") | 1518 close:SetHighlightTexture (DF.folder .. "icons") |
